You are on page 1of 3

Dynamic Prompt Table Depending on a Drop Down Value

Bottom of Form

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;
How can we have DYNAMIC Prompt table for Record
Fields?
By Kannappan Krishnan on December 21st, 2007 under PeopleSoft.
Most of the times we would have faced a requirement of having Dynamic prompt table for
Record Fields. Also PeopleSoft itself very much utilizes Dynamic Prompt table. How can we
achieve the same in our project????
Here we go
This is accomplished by 2 ways
1. Using EDITTABLE fields for Prompt Table
2. Using Dynamic Views
1. Usage of EDITTABLE Fields

In this method, Prompt table property of Record Fields should be assigned with %EDITTABLE
value. Actually what does it mean????
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 = “PERSON_NAME”;
Note: EDITTABLE Field should be present in the SAME Page, where Record Field (In this
case, The Field is nothing but EMPLID) is also referred. If the Record Field is not coming under
Component Search Record Field, there is no need for placing the EDITTABLE field in the Page.
2. Usage of Dynamic Views
As we know, while creating Dynamic view, there is no need to specify the SQL. This SQL
should be generated dynamically and the same should be assigned to the Record Field.
Say for example, if we see the above Record Field TASK_PROFILE_ID, it is assigned with
dynamic prompt table view TL_TSKGRP_DVW and this view TL_TSKGRP_DVW is
dynamically initialized by the following Peoplecode, which can be assigned both in FieldChange
and RowInit events of the Record Field TASK_PROFILE_ID.
RECORDNAME.TASK_PROFILE_ID.SqlText = “SELECT T.TASKGROUP,
T.TASK_PROFILE_ID, T.DESCR FROM PS_TL_TSKGRP_PRF_W T WHERE
T.TASKGROUP = ‘” | &TSKGRP | “‘ AND T.EFFDT =(SELECT MAX(T1.EFFDT) FROM
PS_TL_TSKGRP_PRF_W T1 WHERE T1.TASKGROUP = T.TASKGROUP AND
T1.TASK_PROFILE_ID=T.TASK_PROFILE_ID AND T1.EFFDT<= %datein( ‘” | &maxdate |
“‘) )”;

How to use a Dynamic prompt table? What we need to do for it? What should be the length of
the field to be added in the DERIVED record?
RE: How to use a Dynamic prompt table? what we need to...

In order to use a dynamic promt table; the field that is going to have the dynamic promt must
point to a field in the DERIVED record. The promt table can be dynamically assigned with the
following code.
If(condition)
derivedrecordfield.value promttable1
else
derivedrecordfield.value promttable2
end-if;

RE: How to use a Dynamic prompt table? What we need to...

This is the confusion that many people have. The Dynamic Prompt table is used when the
prompt values are defined in the run time.Lets say if X 1 then use 'EMPLOYEES' as the prompt
table else use 'JOB' as the prompt table. end-if.
Now in the record definition and record field properties you set the prompt table as
fieldname. This fieldname can be any field name. (This is normally taken from a derived work
record). This field should be placed on a page and make it invisble (usually).During the Row
init.....you have to set a value to this field. This value will be the prompt record name. as long as
this record is a valid one and the field contains a valid record name this dynamic Prompt table is
used. Normally we use the field EDITTABLE as the Prompt table container...if the field is
RECNAME then you should use RECNAME instead of fieldname.

You might also like