Today we will see adding values to a drop down list through
Peoplecode. This method becomes essential if you want to dynamically
populate the drop down list based on some condition.
The example given here shows what need to be written in the page
activate of a secondary page that is called from a grid on the main
page. It expects a component variable &rownum that indicates the row
on which the code should fire
Component number &rownum; /* The component variable for passing the rownum from the standard page to the secondary page */ Local SQL &SQL; Local Rowset &rset0, &rset1; Local String &type, &descr; /* Note the SQL and the Rowset objects */ &rset0 = GetLevel0(); &rset1 = &rset0(1).GetRowset(Scroll.LEVEL1_REC); /* Getting the level0 and level1 records */ &FLD = &rset1(&rownum).GetRecord(Record.LEVEL1_REC).GetField(Field.LEVEL1_REC_FIELD); /* Getting the required filed to which the drop down is attached */ &FLD.ClearDropDownList(); /* Clearing all existing values that were with AddDropDownItem() */ &SQL = CreateSQL("SELECT A.TYPE, A.DESCR FROM PS_ABCD_TBL A WHERE A.EFF_STATUS =
'A' AND SOME CONDITION"); /* Creating SQL for fetching values to be added to the drop down */ While &SQL.Fetch(&type, &descr) &FLD.AddDropDownItem(&type, &descr); /* Adding each row from the SQL's output to the drop down */ End-While;
This comment has been removed by the author.
ReplyDeleteThankyou for sharing your peoplesoft knowledge
ReplyDeletePeoplesoft HRMS Key Concepts
ReplyDeletePeopleSoft Set Control Field
Adding and Maintaining Person Of Interest in PeopleSoft
Peoplesoft Row Level Security Search Records
Understanding Future dated security in PeopleSoft
Simplified Way to Provide a Page Access in PeopleSoft
SQL Query to Find Direct Reports for a Manager in PeopleSoft
'Override Position Data' and 'Use Position Data' Option in Job Data Page
How the Various Date Fields on Employement Data Page are Updated
PeopleSoft HRMS key Concepts
Understanding Dynamic Prompts in PeopleSoft
Parallel Processing using Temporary Record with Application Engine in PeopleSoft