How to use Dynamic Variable Names in PeopleCode

How to use Dynamic Variable Names in PeopleCode

  • Record name dynamically by peoplecode

&RECNAME = “JOB”;
&RECNAME = “RECORD.” | Upper(&RECNAME);

Local Record &rec = CreateRecord(@&RECNAME);

 

  • Field name dynamically by peoplecode

&MesssgevalueName = “&ValueFieldName”| “1”;
WinMessage(@(&MesssgevalueName),0);

 

  • Record and Field name dynamically by peoplecode

Local Field &FieldName;
Local Record &REC;

&REC = CreateRecord(Record.TEST_TBL);

For &RW= 1 To &rec.activerowcount

&REC.GetField(@(“Field.” | “STATUS” | String(&RW)).Value = &RW;

end-for;

Posted in Peoplecode.