PeopleSoft translate value 排序

时间:2024-01-09 13:46:50

这个function 可以对record.field 的dropdownlist 排序,也可以把描述前边加个数字。但是有时候用户不接受。所以调用这个方法是比较好的选择。

Function Order_By_Dropdown_List(&Record_name As string, &Field_name As string)
&Record_name = "Record." | &Record_name;
&Field_name1 = "Field." | &Field_name;
&Field = GetRecord(@&Record_name).GetField(@&Field_name1);
&Field.ClearDropDownList();
&Xlat = CreateRowset(Record.PSXLATITEM);
&Xlat.Fill("where FILL.FIELDNAME = '" | &Field_name | "' ORDER BY FILL.FIELDVALUE DESC");
&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;
&Field.AddDropDownItem(&CodeIn, Rept(Char(9), &i) | &DescIn);
End-For;
End-Function;