Wednesday, January 28, 2009

Prompt Table

Prompt Table:
A list of values from which a user can look up and select a value and fill the field on the page. Prompt Table will be assigned in Record Field Properties

Prompt Table can of 3 types

Prompt Table with Edit:
If u set this property and give the table as prompt table in the following text box field in record field properties.Then it implies that user should enter the value which was already there in the Prompt table.

Prompt Table with No Edit:
If you set this property, it implies that user can either select one of the values from the prompt table or he can give his own value which can be store in the table (Not Prompt table :)) So here Prompt table serves as just list of reference values which peoplesoft allows user to select from the list or enter his own value.

Traslate edit (Yes/No) with edit:
If you set this Property then, you should select Yes or No values.

Dynamic Prompt Table:
What we discussed untill now, can be called as Standard Prompt table or Prompt Table or Static Prompt Table. Let us assume, we have a situation where we want to change the prompt table based on some conditions during runtime.

The prompt table which is assigned to a field at runtime is called Dynamic Prompt Table.

With an example we can understand easily.
we have 2 views
PS_SEM1_VW-- View contains first 6 months of the year
PS_SEM2_VW-- View Contains next 6 months of the year.

A PS_MON record have 2 fields
SEMESTER
MONTH

Let us assume, on the page we want these 2 fields ,

PS_MON.SEMESTER will have 2 values -- 1st Sem and 2nd Sem
If user selects "1st Sem" in PS_MON.SEMESTER field then for the second field "PS_MON.MONTH" should get first 6 months as list of prompt values.
If user selects "2nd Sem" in PS_MON.SEMESTER field then for the second field "PS_MON.MONTH" should get LAST 6 months of the year as list of prompt values.

To do this following steps you need to follow,

Step 1: Open the Record Definition of MON
Step 2: Go for the Record field properties of MONTH Field.
Step 3: Set the Property as Prompt Table with Edit
Step 4: Write %EDIT1 in the Prompt table field.
step 5: close it as save it.

Step 6 : Now open the FieldChange peoplecode of SEMESTER
and write the following peoplecode
if MON.SEMESTER=1 THEN
DERIVED.EDIT1=RECORD.SEM1_VW
END-IF;
if MON.SEMESTER=1 THEN
DERIVED.EDIT1=RECORD.SEM2_VW
END-IF;

So now, if you save the above peoplecode and go for Portal(PS Front End,Browser), select the "1st sem" from the SEMESTER Field , this peoplecode fires and first condition satisfies and "RECORD.SEM1_VW" will be assigned to the EDIT1 field of Derived record. As you declared the %EDIT1 as the Prompt table for MON.Month field now peoplesoft understands that the as it was set as %EDIT1 in Record field properties and it is a dynamic prompt table so it takes the value which was stored in DERIVED.EDIT1. So , now whatever value or record name you store it in DERIVED.EDIT1 will become as Prompt table for the MON.Month field.

No comments:

Post a Comment