Friday, 19 October 2012

Table to move the Tab Contents and Layout settings

PSPRSMHPASGPGLT

Content Reference - Check if a user has access to a CREF

-- to check which perm list have access to a portal content ref/folder
SELECT * FROM PSPRSMPERM
WHERE PORTAL_OBJNAME ='HC_GP_SS_EE_PSLP_GBL'


-- to check if a user has access to a portal content ref/folder
SELECT * FROM (
SELECT A.*, C.ROLEUSER, C.ROLENAME
FROM PSPRSMPERM A, PSROLECLASS B, PSROLEUSER C
WHERE A.PORTAL_PERMTYPE = 'P' AND A.PORTAL_PERMNAME= B.CLASSID AND B.ROLENAME = C.ROLENAME
UNION
SELECT A.*, C.ROLEUSER, C.ROLENAME
FROM PSPRSMPERM A, PSROLEUSER C
WHERE A.PORTAL_PERMTYPE = 'R' AND A.PORTAL_PERMNAME = C.ROLENAME) X
WHERE X.PORTAL_NAME = 'EMPLOYEE'
and X.PORTAL_OBJNAME like 'HCHR_PE_EMPL_LEAVE'
AND X.ROLEUSER = 'esstest1'

-- CHECK to see if user has access to menuitem
select * from PSAUTHITEM A, PSROLECLASS B, PSROLEUSER C
WHERE A.MENUNAME = 'PORTAL_COMPONENTS_HR'
AND A.PNLITEMNAME LIKE '%HR_PE_EMPL_LV_EXT%'
AND A.CLASSID = B.CLASSID
AND B.ROLENAME = C.ROLENAME
AND C.ROLEUSER = 'esstest1'
-- which permission lists have access to a menu item
select * from PSAUTHITEM A
WHERE A.MENUNAME = 'PORTAL_COMPONENTS_HR'
AND A.PNLITEMNAME LIKE '%HR_PE_EMPL_LV_EXT%'

Thursday, 27 October 2011

T SQL procedure to update data

-- Counter
DECLARE @pos_cnt int
DECLARE @ok_cnt int
DECLARE @error_cnt int
DECLARE @cntry_code_start_pos int
DECLARE @cntry_code_len int

-- Converted Phone
DECLARE @new_phone varchar(24)
-- Valid Phone Flag
DECLARE @phone_data_ok varchar(1)
-- Valid Country Code Flag
DECLARE @valid_coutry_code varchar(1)

DECLARE @emplid varchar(11)
DECLARE @phone_type varchar(4)
DECLARE @phone varchar(24)
DECLARE @local_phone varchar(24)
DECLARE @country_code varchar(6)
DECLARE @country_code_to_check varchar(6)

-- Declare a temp table
DECLARE @phone_table TABLE (
EMPLID varchar(11),
PHONE_TYPE varchar(4),
NGB_LOCAL_PHONE varchar(18),
MESSAGE varchar(100)
)

SET NOCOUNT ON

declare PhoneData cursor
for select EMPLID, PHONE_TYPE, PHONE, NGB_LOCAL_PHONE, NGB_INTL_DIAL_CD from PS_PERSONAL_PHONE
WHERE PHONE <> ' ' AND PHONE NOT LIKE '%@%'
--AND EMPLID = '16933'
for update

open PhoneData
fetch next from PhoneData INTO @emplid, @phone_type, @phone, @local_phone, @country_code

-- initialise counters
set @ok_cnt = 0
set @error_cnt = 0
while @@fetch_status = 0
begin
-- Check each position of the NGB_LOCAL_PHONE field.
SET @pos_cnt = 1
SET @new_phone = ''
SET @phone_data_ok = 'Y'
SET @phone = LTRIM(@phone)
-- process each position from the Phone field
WHILE @pos_cnt <= 24 BEGIN
-- if it is a number or space, then it is OK
IF CHARINDEX(SUBSTRING(ltrim(@phone), @pos_cnt, 1),' 0123456789') > 0
OR (SUBSTRING(LTRIM(@phone),@pos_cnt,1) = '+' AND @pos_cnt = 1)
OR SUBSTRING(LTRIM(@phone),@pos_cnt,1) = ' ' begin
set @new_phone = @new_phone + SUBSTRING(LTRIM(@phone),@pos_cnt,1)
end
else begin
-- if it is ./()- or non breaking space then replace it with space
IF CHARINDEX(SUBSTRING(ltrim(@phone), @pos_cnt, 1),'./()-') > 0 or
ascii(SUBSTRING(ltrim(@phone), @pos_cnt, 1)) = 160 begin
set @new_phone = @new_phone + ' '
end
-- otherwise it is an error
else begin
SET @phone_data_ok = 'N'
print 'Invalid character ' + SUBSTRING(ltrim(@phone), @pos_cnt, 1) + ' / ASCII ' + convert(char(3), ascii(SUBSTRING(ltrim(@phone), @pos_cnt, 1))) + ' for EMPLID ' + @emplid + ' PHONE_TYPE ' + @phone_type + ' on Pos# ' + convert(char(2), @pos_cnt)
set @pos_cnt = 25
end
end
-- print '@pos_cnt ' + convert(char(2),@pos_cnt) + ' @new_phone ' + @new_phone
set @pos_cnt = @pos_cnt + 1
END
-- remove any leading spaces
set @new_phone = ltrim(@new_phone)
set @country_code = ' '
-- check if the Phone has leading + or 00
set @cntry_code_start_pos = 0
if left(@new_phone,1) = '+' begin
set @cntry_code_start_pos = 2
end
if left(@new_phone,2) = '00' begin
set @cntry_code_start_pos = 3
end
-- if there was an international dialing code present, then try to validate
if @cntry_code_start_pos > 0 begin
set @cntry_code_len = 5
WHILE @cntry_code_len >= 1 BEGIN
set @country_code_to_check = SUBSTRING(@new_phone ,@cntry_code_start_pos,@cntry_code_len)
-- print 'Validating Country code ' + @country_code_to_check + ' for @new_phone ' + @new_phone
set @valid_coutry_code = 'N'
select @valid_coutry_code = 'Y', @country_code = NGB_INTL_DIAL_CD from PS_NGB_INTL_DIALCD B
WHERE @country_code_to_check = B.NGB_INTL_DIAL_CD
AND LEN(B.NGB_INTL_DIAL_CD) = @cntry_code_len
if @valid_coutry_code = 'Y' begin
set @new_phone = ltrim(SUBSTRING(@new_phone, @cntry_code_start_pos + @cntry_code_len , 24))
-- print 'Valid Country code for @new_phone ' + @new_phone + ' @country_code ' + @country_code + ' @new_phone ' + @new_phone + ' @cntry_code_start_pos ' + convert(char(2), @cntry_code_start_pos) + ' @cntry_code_len ' + convert(char(2), @cntry_code_len)
set @cntry_code_len = 0
end
set @cntry_code_len = @cntry_code_len - 1
end
end
if @phone_data_ok = 'Y' and len(@new_phone) <= 17 begin
-- print 'Updating for EMPLID ' + @emplid + ' PHONE_TYPE ' + @phone_type + ' from PHONE ' + @phone + ' to NGB_LOCAL_PHONE ' + @new_phone + ' NGB_INTL_DIAL_CD ' + @country_code
update PS_PERSONAL_PHONE SET NGB_LOCAL_PHONE = @new_phone, NGB_INTL_DIAL_CD = @country_code
WHERE EMPLID = @emplid
and PHONE_TYPE = @phone_type

set @ok_cnt = @ok_cnt + 1
end
else begin
set @error_cnt = @error_cnt + 1
end
fetch next from PhoneData INTO @emplid, @phone_type, @phone, @local_phone, @country_code
end
print 'Update Count ' + convert(char(7), @ok_cnt) + '. Error Count ' + convert(char(7), @error_cnt)
close PhoneData
deallocate PhoneData

Wednesday, 8 June 2011

Find out who last updated a PeopleCode

The following SQL is an example of finding out who last updated a specific Component Record Field PeopleCode but can be modified to check the audit on other types of PeopleCode events as well.

select * FROM PSPCMPROG
WHERE OBJECTID1 = 10
AND OBJECTID2 = 39
AND OBJECTID3 = 1
AND OBJECTID4 = 2
AND OBJECTVALUE1 = ' '
AND OBJECTVALUE3 = ' '
AND OBJECTVALUE4 = ' '
AND OBJECTVALUE5 = 'FieldChange'

Friday, 27 May 2011

PSPROJECTITEM OBJECTTYPE values

The translate values are stored in PS_WHEREUSEDOBJTBL table from Tools ver 8.49.

For older tools version, the list is:

0 Record
1 Index
2 Field
3 Format definition
4 Translate
5 Page
6 Menu
7 Components
8 Record PeopleCode
9 Menu PeopleCode
10 Query
11 Tree structure
12 Tree*
13 Access group*
14 Color
15 Style
16 Not used
17 Business process
18 Activity
19 Role*
20 Process definition
21 Process server
22 Process type
23 Process job
24 Process recurrence
25 Message catalog entries*
26 Dimension*
27 Cube definitions*
28 Cube instance definitions*
29 Business interlink
30 SQL definition
31 File layout definition
32 Component interfaces
33 Application Engine program
34 Application Engine section
35 Message node
36 Message channel
37 Message definition
38 Approval rule set
39 Message PeopleCode
40 Subscription PeopleCode
41 Not used
42 Component interface PeopleCode
43 Application engine PeopleCode
44 Page PeopleCode
45 Page field PeopleCode
46 Component PeopleCode
47 Component record PeopleCode
48 Component record field PeopleCode
49 Image
50 Style sheet
51 HTML
52 Not used
53 Permission list
54 Portal registry definitions
55 Portal registry structures
56 URL definitions
57 Application Packages
58 Application Package PeopleCode
59 Portal Registry User homepage
60 Problem type definition
61 Archive templates (deprecated in PeopleTools release 8.44 and
above).
62 XSLT
63 Portal Registry User Favorite
64 Mobile page
65 Relationships
66 Component Interface Property PeopleCode**
67 Optimization Models***
68 File References***
69 File Reference Type Code***
70 Archive object definitions***
71 Archive Templates (Type 2)***
72 Diagnostic Plug-Ins***

Friday, 25 March 2011

Content Reference (CREF) with link to external site

Navigate to PeopleTools >
Portal > Structure and Content. Chose the folder you would like your
link to be in or you can add a new folder just for this new link if
you'd like.

Now scroll all the way to the bottom and click "Add Content Reference".

Name: Add what ever name you would like here. Users will not see this link.
Label: This will end up being the link the users will click on.
Long Description: Long desc for your link - this will show just below your actual link.
Usage Type: Target
No Template Check Box: Make sure you CHECK this one so the portal template wont wrap around your page.

URL Information

URL Type: Non-PeopleSoft URL
Portal URL: The website you are trying to open (example: http://www.CompShack.com) :)

Now in the Content Reference Attributes of the Content Ref Administration page add the following to get your page to open in a new window:

Name: NAVNEWWIN
Label: You can leave this one blank
Attribute value: true
Translate Check Box: Make sure this is UNCHECKED

Wednesday, 17 June 2009

SQL Server ODBC - 32bit/64bit issue

When using SQL Server 2005 on 64 bit Edition Windows 2005 Server, use 32bit ODBC Administrator (available under C:\WINDOWS\SysWOW64\odbcad32.exe) to configure ODBC Database Sources as the PS client requires 32 bit database connectivity.

Thursday, 11 June 2009

REN server 403 Error

When configuring REN server, if you get an error 403... check these
http://psadmin.wordpress.com/2008/08/04/steps-to-check-ren-server-failure/

Portal Search Index: Separate Application & Process Scheduler Server

In case you have separate servers (physical machines) for App and Process Scheduler, you would need to configure your App Servers and Process Schedulers to point to same folder where the Portal Search Index entries would be stored. In other words, your App and Process scheduler need an entry like this:

Process Scheduler
[Search Indexes]
;=========================================================================
; Search index settings
;=========================================================================
; Search indexes can be given alternate locations if there is an entry here.
; Entries look like: IndexName=fs location (ie EMPLOYEE=c:\temp)
EMPLOYEE=E:\psft\VeritySearch\HCMPRD90

Application Scheduler:
[Search Indexes]
;=========================================================================
; Text-Search index settings
;=========================================================================
; Search indexes can be given alternate locations if there is an entry here.
; Entries look like: IndexName=fs location (ie EMPLOYEE=c:\temp)
EMPLOYEE=\\servername\sharename\HCMPRD90
;

Thursday, 28 February 2008

Windows XP Text Search

To configure Windows XP to search all files no matter what the file type, obtain the latest service pack for Windows XP (currently SP2) and then turn on the Index file types with unknown extensions option.

If you use this method, Windows XP searches all file types for the text that you specify.

This can affect the performance of the search functionality. To do this:

Click Start, and then click Search (or point to Search, and then click For Files or Folders).

Click Change preferences, and then click With Indexing Service (for faster local searches).

Click Change Indexing Service Settings (Advanced). Note that you do not have to turn on the Index service.

On the toolbar, click Show/Hide Console Tree.

In the left pane, right-click Indexing Service on Local Machine, and then click Properties.

On the Generation tab, click to select the Index files with unknown extensions check box, and then click OK.

Close the Indexing Service console.

Thursday, 29 November 2007

Pay Rates on Compensation page dont appear

Check to ensure
a) Companies in COMPANY_TBL have COUNTRY field filled in
b) DFLT_FREQUENCY table is populated for the COUNTRY linked to the COMPANY on JOB record.

Tuesday, 13 November 2007

Workflow emails:link redirection after signon


With PeopleTools 8.4x onwards, the enableDirectLink property is no longer required. This means that when a user clicks on a link from a workflow email, peoplesoft should redirect user to the linked page automatically. This should happen even if the user is not logged on and has to enter userid and password on usual signon page. However, for this to happen, the "Allow Public Access" checkbox must be unchecked on the Web Profile that is currently being used.

Wednesday, 18 July 2007

CI_JOB_DATA_HIRE component interface no longer available in 8.9

CI_JOB_DATA_HIRE component interface no longer available in 8.9

The CI for JOB_DATA_HIRE is no longer available from version 8.9 onwards. PeopleSoft's Hire process has changed and now uses 2 components therefore it is not possible to have one single CI to hire employees. The solution is to use CI_PERSONAL_DATA and CI_JOB_DATA_EMP. However, the drawback is that you need to know the EMPLID that has been generated by first CI. The solution is to use a global variable and set it when new EMPLID is assigned.

Monday, 11 June 2007

Business Unit & SetIDs

From PeopleSoft ver 7.5 onwards, PeopleSoft has been providing the functionality of Business Units and SetIDs. The two elements provide greater flexibility and functionality in terms of not only managing the organisation structure but also in terms of managing and sharing setup data (i.e. departments, job codes, absence codes, locations etc). Further, the Business Units can be used for row level security i.e. to provide access to one or more business units to individual permission lists within PeopleSoft.

Business Units

Business Units represent logical units within your organization. They can be used for organisation structure and reporting purposes. By using Business Units, one can group employees by administrative organisation structure (i.e. for HR purposes) or actual business structure (i.e. Org Structure). Business Units may be, for example, companies, agencies, subsidiaries, divisions, departments, or branch offices within your organization. Alternatively, you may choose to have a single Business Unit which represents your entire organization.


TableSets and SetIDs

Once Business Units have been defined, you can define TableSets, or groups of tables, for your setup/control tables, so that you can share the same code values across more than one Business Unit within your organisation. Additionally, the TableSet feature also allows you to restrict access to specific data to only those users who need it, while storing all of your data on the same tables. This flexibility enables organisation to centralise common data / information whereas the other data/information can be decentralised i.e. Departments, Job Codes, Absence Types etc. A Business Unit is then associated with employee's Job record in the organisation and using Business Unit, you can specify how the defaults for currencies and country codes will work.

Where a Business Unit organizes your company or your organization, SetIDs help you organize your data within the system. The HRMS system uses tables (Control Tables or Prompt Tables) that use a high-level key that enables you to identify and retrieve data from the system. A secondary high-level key, referred to as a SetID, has also been added on various tables. SetIDs are simply the labels used to identify a TableSet. Business Unit and SetID functionality in PeopleSoft HRMS also provides you with a higher business level for reporting purposes and other business data roll-up.

Tuesday, 29 May 2007

Copy Missing Departments after Tree Copy

Since Copying a Tree via App Designer doesnt copy the department records in DEPT_TBL, the tree and department table may become out of sync. Here is a little SQl to copy Department records in DEPT_TBL once you have copied the Tree. The SQL is for SQL Server platform and relies on database links.


INSERT INTO PS_DEPT_TBL
SELECT B.* FROM PSTREENODE A, HCMPRD88.dbo.PS_DEPT_TBL B
WHERE A.TREE_NAME = 'DEPT_SECURITY'
AND A.EFFDT = '2006-01-01'
AND NOT EXISTS (SELECT 'X' FROM PS_DEPT_TBL
WHERE A.TREE_NODE = DEPTID)
AND A.TREE_NODE = B.DEPTID


In version 8.8 and abover, PeopleSoft provides a web based page to export and import Tree. This can be accessed via -Company Hierarchy, Administer Tree, Copy/Delete Tree.

Monday, 21 May 2007

Role, Permission List that contain a Page

select A.CLASSID , B.CLASSDEFNDESC, C.ROLENAME, D.DESCR
FROM PSAUTHITEM A, PSCLASSDEFN B, PSROLECLASS C, PSROLEDEFN D
WHERE A.PNLITEMNAME = 'COMPETENCY_TABLE'
AND A.CLASSID = B.CLASSID
AND A.CLASSID = C.CLASSID
AND C.ROLENAME = D.ROLENAME