Search This Blog

Monday, January 28, 2013

PeopleSoft Signon Process

Peoplesoft adopted the n-tier architecture from 8.x versions onwards.

There are different ways to connect to database.

1. Direct login to database with database userID/Password. (2-Tier)

  
     Below are the ways we connect to database directly.

     Login through Toad/SQL Plus using SYSADM as userID/pwd.    
  •      This the the powerful userID.
  •      Using this we can do DML/DDL from backend. Usually PSAdmin/Database Admin use these.
  •      Sometimes Application Developers do require access in Dev environments.
  •      We can also create other Database Userids which have only select access to database.

     Login through App Designer. 

  1.      In the Login Window, user has the option to select Type of  login.
  2.      There if we select Database say Oracle then we are connecting directly to database.
  3.      User enters the credentials,
  4.      App designer first connects to database using the connectID provided in the Configuration  Manager.Usually, ConnectID will be people. 
  5.     Once connection is successful, the user 'people' issues a couple of select statements on peopletools  Security tables (namely, PSDBOWNER/PSSTATUS/PSACCESSPRFL/PSOPRDEFN) to validate the credentials provided.
  6.     Gets the owner name from PSDBOWNER, usually SYSADM
  7.     Then checks the tools release.
  8.     Retrieves the SYMBOLICID (usually SYSADM1)  for the given UserID from PSOPRDEFN. 
  9.     Now gets the ACCESSID/PWD (usually SYSADM) from the PSACCESSPRFL which is linked  to the SYMBOLICID.
  10.     Disconnects from Database
  11.    Connects using AccessID namely SYSADM/pwd. This UserID is powerful as it had full access to  the database.
  12.    Now App Designer opens and is awaiting user action.

      Login through Application Server.
   
  •       This happens when we boot the server using PSADMIN utility.
  •       The Appserver Config file has the details of UserID/Pwd and also the ConnectID/Pwd. 
  •       So initial connection happens through the ConnectID  namely 'people' , and then validates the credentials against the Peopletools Security tables as mentioned above. 
  •       Once validated, it disconnects and connects again using UserID/Pwd present in the file.
  •       This way a persitent connection is made to the database by the Application server. 

Thursday, January 24, 2013

Component Properties: Difference between Search Record and Add Search Record

Below are the Search records we can add through Component properties.


Search Record Name
 Displays the component's default search record when you access the component in update or display mode.

Note. You can assign an override search record to a component at the menu level. If the component uses an override search record, the search record displayed in the Override Search Record will be different from this one and you should search it instead.

Add Search
 Displays the component's search record when you access the component in add mode.


Source of above information: Peoplebooks

When to use Add Search Record?
 In a case where we want to control the data that should be added or for a requirement where we add a counter for the ID.

Lets see a simple example where the Search record and Add Search record is used.

The below Events page helps us to create different types of  Campus Events.

Let's first see how this page works.

Search shows us the list of Campus Events available.
Lets see the data for Event ID 000010005.

 Now, Lets Add a New Event ID. In this case , we use a different Search record because we need to setup a new Event ID.





  Lets see how we can do this in App Designer.

  Below is strucuture of these search records.
 The Standard Search record is a view which retrieves data from primary record of the component.
 For Add Search record, Primary record of the component is used. The EventID is set to '0'  at fielddefault peoplecode. Once the page is saved, the peoplecode in the SavePrechange event will get the most recent Event ID and then adds plus 1. (i.e if recent EventID is 121 ,then new Event ID will be 121 +1 = 122)




Friday, January 11, 2013

Difference between key , duplicate order key , Alternate Search key

Record Field Properties:

Difference between key , duplicate order key , Alternate Search key

Key:
  •     Helps us in uniquely identifying a row of data.
  •     The primary key must be the first field in the record, followed by the next most important key, and   so on.
  •     Key fields are followed by duplicate order keys, in order of importance, then by fields that are not keys.
  •     Can be used as Search key or listbox item or both.
Duplicate order key
  • Allows duplicate values.
                Example. Same Employee having multiple degrees at same date.
  • Do not create a related language record with a duplicate order key.
  • Can be used as listbox item.
Alternate Search key 
  •  This displays the field in the Advance Search and builds indexes on this field. 
  •  This will help in fast retrieval of data.
  •  Also keep in mind that, as these database indexes consume disk space, mark the field alernate search  key only if it is really required.
  •  Alternate key fields can be placed anywhere among regular fields (non-key fields), in any order. They do not need to be grouped.
  •  It is displayed in the Advanced search and can be used as Listbox item.
All these 3 keys are mutually exclusive.

Sunday, August 19, 2012

App Designer Login Issues

Problem: Not able to change peopletools objects from App designer.
Resolution: Need to add "PeopleSoft Administrator" role to the userid.

Problem: Invalid username/password while logging to App designer.
Resolution: check the TNS entries placed in Orahome (Place where oracle software is installed) /network/admin folder. See that the SID , port and domain are correct.

Problem; Want to change the default PS logo.
Resolution: One quick way is to create an image object of same dimension (usually 145 x 41) , and upload through App designer.



Friday, March 9, 2012

Hiding a row in a grid

&rs(&i).visible=false;

"rs" is the rowset of the grid. i.e &rs = getrowset(sroll.RECNAME);
"i" -- represents row of the grid.
 Let us take a scenario where we want to hide employee rows who are contractors
Sample grid data
Sno   Emplid  Name  EmpType
1       14201   Kiran      P 
2       14202   Krishna  C
3       14203   Ravi       P   

Now , I want to hide Contractor. In this case it is Krishna.
So I will traverse through the rowset

Buffer values of the grid before hiding the rows.
1 Kiran
2 Krishna
3 Ravi

for &i=1 to &rs.activerowcount

if  &rs(&i).EMP_HIRE_DTL.EMP_TYPE = "C" then
&rs(&i).visible = false; 
end-if;
end-for;

Buffer values of the grid after hiding the rows.

1 Kiran
2 Ravi
3 Krishna

Hope the above info is useful.

Tuesday, January 24, 2012

Extracting file details from unix into peoplesoft

There are some cases where we would like to get the File details like timestamp etc from unix server into peoplesoft.

There are different approaches that we can follow to get file details from unix file server.

1. Use Shell script and write file attributes like owner,filename,lastupddttm etc to another file and then
    call this script from peoplecode Exec function.
2. User shell script and write file attributes to database record and then call this record from peoplecode.
3. Use Java language file class concept. Like instantiate the Java file object and then call the javamethod from   peoplecode to get the file attributes.

Let us see the first approach.

1. Use Shell script and write file attributes like owner,filename,lastupddttm etc to another file and then
    call this script from peoplecode Exec function.
 a) Create a shell script and execute from server to check the correctness of the script.
     pseudocode:
     Get the file details using ls -ltr command and store the output to variable
     Write these variables to a file.
b)  since we need file attributes of a particular file from a particular env, pass the filename and env as input.
c)  Use exec command from peoplecode and execute the script.
One challenge is in getting the file datetime values. In unix, ls -ltr will give file datetime till hours and mins but not secs.
Example: Abc.txt  Jan 14 5:29 but there are chances file might get overriden during the same time like 5:29 14 secs might get overriden at 5:29 42 secs. We cannnot find this using the ls -ltr command.  
To overcome this , use the perl script which will give the time till secs.

Thus we can get the file attributes from the above steps. Hope the info is useful.






Preserve case parameter in addattachment function

Below post is helpful to those who have encountered an issue with the file extension getting converted to lower case  instead of retain the same.

We use add_attachment(list_of_param....) to upload files to the server.
Inside the Add_attachment(list_of_param....) function there is a builtin library function addattachment(list_of_param....) which actually uploads the file in the server.

There is one parameter called preserve case which helps to retain the extension which user had uploaded.
By default, it is set to false.
That means if user uploaded "Test_File.TXT" , the file name on the server will be "Test_File.txt".

There could some cases where you feel the extension of the file should not change.
In that case , change the value to 'true'.

AddAttachment(URLDestination, DirAndFilename, FileType, UserFile[, MaxSize]                                                                     [, PreserveCase, UploadPageTitle])

Above syntax is from tools version 8.49