October 22, 2010

Methods to create dynamic prompt.

1. We will create two views for the prompt. Suppose Country and State. Here we will create one view for Country and another for state with country as the key field, then place these fields in the page but make sure that the country is above the state in the page order.
2. Using the %EDITTABLE
In this post I will attempt to explain how to dynamically assign a prompt table depending on a drop down value (see image below)



The table behind the grid is PORTAL_SECDYVW and as you can see from the image below, the PORTAL_AUTHNAME field has %EDITTABLE defined as a prompt table. The PORTAL_AUTHNAME is the "Name" column you see on the grid.



Now, we would want to assign table PSCLASSDEFN_SRC as prompt if the drop down value is Permission list and PSROLEDEFN_SRCH if the value is Role.
/*Record PeopleCode: PORTAL_SECDYVW.PORTAL_AUTHNAME.FieldChange*/
Evaluate PORTAL_SECDYVW.PORTAL_PERMTYPE2
When "P"
DERIVED.EDITTABLE = "PSCLASSDEFN_SRC";
PORTAL_SECDYVW.DESCR = PSCLASSDEFN.CLASSDEFNDESC.Value;
Break;
When "R"
DERIVED.EDITTABLE = "PSROLEDEFN_SRCH";
PORTAL_SECDYVW.DESCR = PSROLEDEFN.DESCR.Value;
Break;
When-Other

End-Evaluate;

3. Using a dynamic view to fetch the value from the backend table based on the value in the country field. For example
Create a dynamic view with the following query
Select state from ps_table where country = :1
Then using the value from the country table in the field change of the country table we can fill the state table

No comments:

Post a Comment

Page field configurator

Peoplesoft study   Page field configurator This is an enterprise component and not a tools feature ( https://docs.oracle.com/cd/F138...