Wednesday, August 4, 2010

Dynamic Dropdown Values

&FLD = GetRecord(Record.HM_EMP_BEN_PLAN).GetField(Field.HM_BEN_PLAN_TYPE);
&FLD.ClearDropDownList();
&Xlat = CreateRowset(Record.PSXLATITEM);
&Xlat.Fill("WHERE FILL.FIELDNAME = 'HM_BEN_PLAN_TYPE' AND FILL.FIELDVALUE IN ('10','01') AND FILL.EFFDT = (SELECT MAX(EFFDT) FROM PSXLATITEM B WHERE B.FIELDNAME = 'HM_BEN_PLAN_TYPE' AND B.FIELDVALUE = FILL.FIELDVALUE AND EFFDT <= SYSDATE)");
&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