Thursday, March 6, 2014

Dynamic Prompt Table for Record Field on PeopleSoft Page

Sometimes a situation in project work arises to have a dynamic prompt table for record fields on PeopleSoft pages. In PeopleSoft itself dynamic prompt table functionality is utilized to a great extent. So, the question is: How to achieve the same??

We can accomplish dynamic prompt table in 2 ways:
  1. Using EDITTABLE fields for Prompt Table.
  2. Using Dynamic Views.

1. USING EDITTABLE FIELDS:

In this method, Prompt table property of Record Fields should be assigned with %EDITTABLE value. It means!!!!! 

We will try to understand this by an example. If want to assign dynamic prompt to our Record Field EMPLID. In this case in Record Field Property under Edit tab edit should be prompt table and value should be %EDITTABLE 

Now Prompt Table value for the Record Field is populated from the Record Field DERIVED.EDITTABLE value. The Record Field DERIVED.EDITTABLE should be assigned with value either in one of the Peoplecode events (Either in FieldChange or FieldEdit or RowInit events). This is simply done by: 

DERIVED.EDITTABLE = "EMPLOYEES"; 

One point to remember here is that you can also do this by some other edit field of delivered record DERIVED as 

DERIVED.EDIT1 = "EMPLOYEES"; 

But in this case you need to set Prompt table property of Record Field to be %EDIT1 value. 

Note: EDITTABLE Field should be present in the SAME Page, where the Record Field (In this case, The Field is EMPLID) is. 

2. USING DYNAMIC VIEWS:

As we know, while creating Dynamic view, there is no need to specify the SQL. This SQL should be written and assigned to the Record Field dynamically using peoplecode. 

For example Record Field EMPLID, it is assigned with dynamic prompt table view TEST_DVW and this view TEST_DVW is dynamically initialized by the following Peoplecode, which can be assigned both in FieldChange and RowInit events of the Record Field EMPLID: 

<RECORDNAME>.EMPLID.SqlText = "<write your SQL here>"; 

Note: One interesting fact about dynamic views is that you can change its output on page considering some factors like User permissions, other key field values on page etc. 

No comments:

Post a Comment