We can accomplish dynamic prompt table in 2 ways:
- Using EDITTABLE fields for Prompt Table.
- Using Dynamic Views.
1. USING EDITTABLE FIELDS:
In this method, Prompt table property of Record Fields should be assigned with %EDITTABLE value.
Let’s take an example to understand this. 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 put the field DERIVED.EDITTABLE on the page and make it hidden. The 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";
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 EXAMPLE_DVW and this view EXAMPLE_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