Code to dynamically change the dropdown values for a field

Local Rowset &Xlat;
&FLD = GetRecord(Record.JOB).GetField(Field.ACTION);
&FLD.ClearDropDownList();
--- This particular part is useful only if the dropdown values are coming from translate table

&Xlat = CreateRowset(Record.PSXLATITEM);
&Xlat.Fill("WHERE FILL.FIELDNAME = 'myfieldname'");
&Xlat_cnt = &Xlat.ActiveRowCount;
For &I = 1 To &Xlat_cnt
&CodeIn = &Xlat.GetRow(&I).GetRecord(1).FIELDVALUE.Value;
&DescIn = &Xlat.GetRow(&I).GetRecord(1).XLATLONGNAME.Value; &FLD.AddDropDownItem(&CodeIn, &DescIn);
End-For;

No comments:

Post a Comment