Thursday, January 30, 2014

Understanding Dynamic Prompts in PeopleSoft

Every so often during the interviews, we encounter this question a lot and without a proper understanding we end up improvising the explanation.
The question is - What do you know about dynamic prompts and how we can create them ?

Well, Lets get to the point and try understanding the concept with examples.

Prompts enable user to select a value from the list of predefined control values for a field in a page during transactions.
For Example, when we create a new department, to select the company we click on the prompt for company field and select one of the listed values.

In this case, the list of companies displayed in the prompt is static and is directly pulled from the record COMPANY_TBL.
Below is the record field properties of COMPANY field in the record DEPT_TBL,



In this case, there is no control over what are all the values will be prompted to the user, whatever is available in the record COMPANY_TBL, will be listed.

Please also see -
PeopleSoft Set Control Field Concept and Tableset Sharing
PeopleSoft 9.1 Person Model
Adding and Maintaining Person Of Interest in PeopleSoft
PeopleSoft Set Control Field
Peoplesoft Row Level Security Search Records
SQL Query for Max Effective (MAX (EFFDT) dated row from JOB table
How to Resolve a Row Level Security Issue in PeopleSoft 
How to find the List of Users Assigned to a Role 
Creating Query Report with PS Query in PeopleSoft  
PeopleSoft HRMS Online Training

Dynamic prompts on the other hand, enable us to have control over how and what will be the prompt values. i.e, based on a particular field value we can build a prompt dynamically during run time.

Lets understand it more with two scenarios:


Scenario 1 (Dynamic Prompt using Dynamic View)

As per delivered PeopleSoft functionality, Compensation Rate Codes are created to be used by all the companies. Common set of Compensation Rate Codes result in a huge number of Compensation Rate Codes being rendered to a HR Users when they define a person’s compensation on their Job Data.
However business want us to customize delivered PeopleSoft pages that enable HR Users to access and view only Compensation Rate Codes which are applicable for person’s company.



You see above, HR user is doing a transaction in the JOB_DATA component for an employee, NZ11SN19 who belongs to the company "107". So, in compensation page when HR user clicks the prompt button for "Rate Code" field, Only the compensation rate codes defined for company 107 should be available for selection.

This is called dynamic prompt, and it can be implemented using record type "Dynamic View" and is one way of implementing dynamic prompts.

Let's find out how to implement this-

Step 1: Create a record of type "Dynamic View" using app designer with the name - FMC_CRCCMP_DVW



Make the fields, COMPANY & COMP_RATECD as both "Search key" and "List Box item" and all other fields as "List Box item" only.

Step 2:  In the COMPENSATION record, open the record field property of COMP_RATECD, go to "Edits" tab and assign the newly created dynamic view FMC_CRCCMP_DVW as the prompt table edit.



Step :3  Add below peoplecode in the RowInit record field event of COMP_RATECD field

  &Company = JOB.COMPANY.Value;
  If %Component = "JOB_DATA" Or Then
     &fmccrcdyvwsql = SQL string which fetches the compensation rate codes WHERE COMPANY = &Company (Current person's company)


     COMPENSATION.COMP_RATECD.SqlText = &fmccrcdyvwsql;
     End-If;       

Where &fmccrcdyvwsql is SQL string which will pull the compensation rate codes valid only for the current person's company.

Note - The above SQL is valid only when the below component is customize to define the Compensation rate codes based on the company:
Navigation - SetUP HRMS -> Foundation tables -> Compensation rules -> Comp rate code   table

Please also see -
How the Various Date Fields on Employement Data Page are Updated
'Override Position Data' and 'Use Position Data' Option in Job Data Page
Adding and Maintaining Person Of Interest in PeopleSoft
Hiring a Person in PeopleSoft
How to Resolve a Row Level Security Issue in PeopleSoft
How to find the List of Users Assigned to a Role
SQL Query to find all the Direct Reports for a Manager
Simplified Way to Provide a Page Access in PeopleSoft 
Understanding Component Interface in PeopleSoft 
Business Unit, Company and Regulatory Region in PeopleSoft
Process Security in PeopleSoft
  

Scenario 2 (Dynamic Prompt using Derived Record Field):

You would have noticed many times in JOB_DATA component - Payroll page, when you select payroll system as "Payroll Interface" and then click on the prompt for "Paygroup" field you see the prompt as below:



But when you select payroll system as "Global Payroll" and click on the prompt button for Pay Group field, you see below prompt:


See the difference in two prompt pages, Its because in both cases the prompt table is   different. In first case when you selected Payroll System as "Payroll Interface" then the prompt table for the field "Pay Group" was PAYGROUP_TBL whereas when you selected Payroll System as "Global Payroll" then the prompt table for the same field "Pay Group" was GP_PYGRP.

This is also called dynamic prompt, and it can be implemented using a field which is defined in record type "Derived/Worked" and is another way of implementing dynamic prompts.

Now, Let us see how its been implemented.

Step 1: Add a field EDITTABLE6 in the derived record named - DERIVED.       




Step 2: Open the record field properties of the field PAYGROUP in JOB table
     

Step 3: Add below PeopleCode in "Field Change" event of the field PAY_SYSTEM_FLG(Payroll System)

  If JOB.PAY_SYSTEM_FLG = "GP" Then
    DERIVED.EDITTABLE6.Value = Record.GP_PYGRP;
  Else
    If JOB.PAY_SYSTEM_FLG = "PI" Then
      DERIVED.EDITTABLE6.Value = Record.PAYGROUP_TBL;
    End-If;
  End-If;


So, if you understood both the scenarios explained above, did you find any difference between them ?
Well, Below is the difference:
Scenario 1 - Dynamic prompt is created using "Dynamic View" record definition and the rows selected in the prompt are controlled by SQL query supplied to the SQLTEXT property of record field based on certain condition.
Here, rows displayed in the prompt can be controlled but structure of the prompt remains same because underlying prompt record doesn't change.

Scenario 2 - Dynamic prompt is created using a field added in a record definition of type "Derived/Worked", the field name is used as the bind variable (%FieldName) which is mentioned in the record field properties. Then in the peoplecode, record definitions are assigned to this bind variable based on certain condition which becomes the prompt record.
Here, structure of displayed prompt appears different each time because underlying prompt record  is changed.


Please also see -
Understanding Future dated security in PeopleSoft

Simplified Way to Provide a Page Access in PeopleSoft
How to find the List of Users Assigned to a Role
Hiring a Person in PeopleSoft
Peoplesoft Row Level Security Search Records
PeopleSoft Functional and Technical Online Training


Want to learn PeopleSoft technical module thoroughly? I have several videos with total duration of over 50 hours.


Following is the link to the YouTube videos Technical
Click here to see course contents

Click here to know how it works

However, if you want to save money by purchasing whole module instead of in parts then visit this page to get more details PeopleSoft Functional and technical online training


7 comments:

  1. For steps in Dynamic Prompting, following the steps didnt work initially. Field DERIVED.EDITTABLE6 had to be added to the page as an invisible field to the page. Without it, it would throw an error. Please include this to the steps as well. Thanks

    ReplyDelete
  2. Using dynamic view - isn't the code be in fieldchange event too.

    ReplyDelete
    Replies
    1. I Think code should be moved to Fieldchange instead of ROwInit for Dynamic view scenario.Rowinit will trigger on all rows of data

      Delete
  3. People Soft HRMS Technical/Functional http://www.21cssindia.com/courses/people-soft-hrms-technical-funcational-online-training-129.html People Soft HRMS Technical/Functional People Soft HRMS Technical/Functional People Soft HRMS Technical/Functional People Soft HRMS Technical/Functional People Soft HRMS Technical/Functional People Soft HRMS Technical/Functional "Courses at 21st Century Software Solutions
    Talend Online Training -Hyperion Online Training - IBM Unica Online Training - Siteminder Online Training - SharePoint Online Training - Informatica Online Training - SalesForce Online Training - Many more… | Call Us +917386622889 - +919000444287 - contact@21cssindia.com
    Visit: http://www.21cssindia.com/courses.html"
    Peoplesoft Finance AP, AR, and GL http://www.21cssindia.com/courses/peoplesoft-finance-ap-ar-and-gl-online-training-130.html Peoplesoft Finance AP, AR, and GL Peoplesoft Finance AP, AR, and GL Peoplesoft Finance AP, AR, and GL Peoplesoft Finance AP| AR| and GL Peoplesoft Finance AP| AR| and GL Peoplesoft Finance AP| AR| and GL "Courses at 21st Century Software Solutions
    Talend Online Training -Hyperion Online Training - IBM Unica Online Training - Siteminder Online Training - SharePoint Online Training - Informatica Online Training - SalesForce Online Training - Many more… | Call Us +917386622889 - +919000444287 - contact@21cssindia.com
    Visit: http://www.21cssindia.com/courses.html"

    ReplyDelete
  4. For Dynamic View "Make the fields, COMPANY & COMP_RATECD as both "Search key" and "List Box item" and all other fields as "List Box item" only." This is not mandatory, I have tested without doing that also it is working..Please correct me if I am wrong.

    ReplyDelete
  5. Pročitajte moje svjedočanstvo o tome kako sam dobio brzi zajam od pouzdane tvrtke. Pozdrav, ja sam gospođica Veronica iz Hrvatske. Bio sam u financijskoj situaciji i trebao sam kupiti kuću. Pokušao sam potražiti zajam od različitih kreditnih tvrtki, privatnih i korporativnih, ali nije išlo, a većina banaka mi je odbila kredit. Ali kako bi Bog htio, upoznali su me s privatnim zajmodavcem koji mi je dao zajam od 90,000 eura i danas imam vlastitu kuću i vlasnik sam tvrtke i trenutno mi je dobro, ako morate ići na tvrtka za osiguranje zajma. bez kolaterala, bez provjere kreditne sposobnosti, samo 3% kamatna stopa i supotpisnik s boljim planovima i rasporedom otplate, kontaktirajte Davidson Albert Loan (davidsonalbertloan@gmail.com). On ne zna da to radim, ali sada sam tako sretna i odlučila sam dati ljudima više informacija o njemu i želim da ga Bog još više blagoslovi. Možete ga kontaktirati putem njegove e-pošte. davidsonalbertloan@gmail.com
    {WhatsApp: +38761545894}

    ReplyDelete