Saturday, 9 July 2011

How to create dynamic prompts in PeopleSoft?


 

PeopleSoft Technical articles - Peoplecode
Here is a step by step tutorial to create dynamic prompts in PeopleSoft?
Requirement: If you  have a requirement to create a prompt table with values based on another prompt on the same page. For example prompt(1) for bank id and prompt(2) for bank Branchs.
Now if you want to be able to filter bank names on prompt(2) based on the value of prompt(1). So if a user picks some bank id in prompt(1), prompt(2) will only display Bank Branchs that are associated with bank.
Solution:
One way of doing this is to use %RECNAME_EDIT functionality.
1- CREATE  A RECORD
2- ADD A FEILD Bank ON WHICH YOU WANT TO CREATE DYNAMIC PROMPT
3- GO TO THE RECORD FEILD PROPERTY OF THAT FEILD
4- NAVIGATE TO EDITS TAB AND SET PROMPT TABLE  VALUE TO %RECNAME_EDIT
5-NOW WRITE THE PEOPLECODE ON THE ROWINIT OF THAT FEILD IN THE RECORD
6- MAKE SQL VIEWS ON YOUR CRITERIA

NOW ASSIGN THE REQUIRED SQL VIEW TO THE FEILD DEPENDING UPON THE CRITERIA

Global string &addBank;
Component string &addBank_compnt;

If %Component = Component.P1_ESS_BANK Then
If &addBank = "ADD" Then
DERIVED.RECNAME_EDIT.Value = "P1_BANK_EC_VW2";
Else
DERIVED.RECNAME_EDIT.Value = "P1_BANK_EC_VW1";
End-If;
Else
DERIVED.RECNAME_EDIT.Value = "P1_BANK_EC_VW1";
End-If;
&addBank_compnt = &addBank;
&addBank = "";

No comments:

Post a Comment