Search This Blog

Saturday, February 2, 2013

Iscripts Example



Iscripts by Example:

Create a derived work record which starts with WEBLIB_XXXXXXXX
Include a field ISCRIPT1 which holds the peoplecode function for Iscript as show below.

Record Definition: WEBLIB_HELOWRLD


The below script , echoes the value entered in the text box.

Function IScript_HelloWorld()
Below is the code placed in fieldformula




Security:
After you create a WEBLIB record, and your functions, you must add them just as you would add a page to an application.

Adding the WEBLIB record to permission list PTPT1000. Below is the snapshot.



Click on Edit to control the type of access to the functions.

Testing: Login to PIA and copy the below URL.


http://localhost:8000/psp/hr9stg/EMPLOYEE/HRMS/s/WEBLIB_HELOWRLD.ISCRIPT1.FieldFormula.IScript_HelloWorld

Note: You need to replace 8000 with webserver port and hr9stg with the domain name.

The below script , echoes the value entered in the text box.
 

This completes the creation and testing of iscript.

Note:  You might have observed that just like the content reference which has a URL , the iscript is also a URL.
So, just like the way we register component through App designer to make the link available to the user in PIA, similar way we can register for iscript as well.

Will discuss in detail on the registring iscript in another post. Below arrow shows the registration wizard for Iscript in App Designer.


 





Wednesday, January 30, 2013

%P(1) in SQL object

The %P(1) refers to the first parameter of SQL definition.

Example: Below view retrieves EMPLID,NAME and EMAIL_ADDRESSES from two tables PS_NAMES and PS_EMAIL_ADDRESSES.

SQL Definiton VC_EMP_NM => %P(1).EMPLID,%P(1).NAME,%P(2).EMAIL_ADDRESS

VC_EMP_NM is the SQL definition which is referenced in SQL Editor as
select %SQL(VC_EMP_NM,NM,EML) from PS_NAMES NM, PS_EMAIL_ADDRESS EML
where NM.EMPLID=EML.EMPLID

NM -- 1st Param nothing but alias of PS_NAMES record
EML -- 2nd Param nothing but alisa of PS_EMAIL_ADDRESS record

which is resolved into
select NM.EMPLID,NM.NAME,EML.EMAIL_ADDRESS from PS_NAMES NM, PS_EMAIL_ADDRESS EML
where NM.EMPLID=EML.EMPLID

Below is the snapshot.



 





Monday, January 28, 2013

PeopleSoft Edit tables

In PeopleSoft , we have different ways to edit  (Dictionary meaning ,To modify or adapt so as to make data we enter suitable or acceptable).

Edits helps user to select valid data from a list of values. Below are the types of Edit available in PeopleSoft

1. Prompt Table With NoEdit
2. Prompt Table With Edit
3. Yes/No Table Edit
4. Translate Table Edit
















1. Prompt Table With NoEdit
    Displays list of values for the user to select. If user enters some other value which is not present in the list
    then the new value is accepted by the system.

2. Prompt Table With Edit
    Displays the list of values for the user to select. User had to select only those values. If some other value is
    entered the system throws an error saying, "Invalid Value".

3. Yes/No Table Edit
    This Edit can be used for checkbox. By Default it will be checked (Y). For Example, In any of the
    application pages, if there is an Address details which needs to be provided we can use this option.
    Address same as Permenant Address? 

4. Translate Table Edit
    This will list the users to select data from dropdown. The length of the field should not exceed 4 char.
    The translate values for this type of field are stored in Peopletools table PSXLATITEM.
    Example: This is used to display Marital Status of an employee etc.


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.