How to Populate Drop down list at Runtime using PeopleCode

The solution is simple, using peopleCode. In that page where you need to show all the 5 translate values, you assign that field and you don’t need to worry for that page. Now, for the other page, where you need to show only 3 values, you need write peoplecode in record rowinit event. First, Store the following code given below in a function library. Then, create a SQL object which will return the required 3 field values and their descriptions from PSXLATITEM. Then pass the SQL object name, Record object name and field object name as string to the below provided source code from the rowinit event. The rowinit peoplecode will look like this:
&Rcd = "Chinnu_raavi"; /* Record name */ 
&Fld = "Chinnu_raavi"; /*field name */ 
&SQL = "Chinnu_raavi_SQL"; /* SQL object name */ 
PopulateDropDown(&Rcd, &Fld, &SQL); 

Function PopulateDropDown(&RcdName As string, &Fldname As string, &SQL_name As string)
    
   Local Field &Fld;
   Local SQL &SQL;
   Local string &CodeIn, &DescIn;
   
   &Fld = GetRecord(@("Record." | &RcdName)).GetField(@("Field." | &Fldname));
   
   &Fld.ClearDropDownList();
   &SQL = GetSQL("SQL." | &SQL_name);
   
   While &SQL.Fetch(&CodeIn, &DescIn)
      &Fld.AddDropDownItem(&CodeIn, &DescIn);
   End-While;
   
 End-Function;

SHARE

peoplesoft

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

1 comments:

  1. ทดลองเล่น pg slot เว็บเกมสล็อตออนไลน์น้องใหม่จากค่าย พีจีสล็อต ค่ายเกมสล็อตออนไลน์อันดับ 1 ที่ลูกค้าทั่วโลกต่างยกย่องให้เป็นเว็บเกมสล็อตออนไลน์อันดับ 1 ตลอดการ

    ReplyDelete

Phaniraavi@gmail.com