PeopleSoft-下拉值权限控制

如果要对一个下拉值字段进行对应的权限控制,思路:先清空原有的下拉值,然后根据权限添加对应的下拉值。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* 按权限显示字段translate value ; */
Local string &strC_Sched_Type;
Local string &strXLATLONGNAME;
Local string &isFlag;
&FLD = GetRecord(Record.C_DATA_LOAD).GetField(Field.C_SCHED_TYPE);
/* 清空字段默认translate value;*/
&FLD.ClearDropDownList();
Local number &SEQ_NUM = 1;
/* 如果权限表中没有进行授权,则在字段translate value 中插入NULL; */
SQLExec("select 'X' FROM ps_c_data_auth_tbl WHERE emplid = :1 AND ROWNUM = 1 ", %EmployeeId, &isFlag);
If &isFlag = "X" Then
Local SQL &sql = CreateSQL("SELECT d.c_sched_type from ps_c_data_auth_tbl d WHERE d.emplid = :1 ORDER BY C_SEQ ASC; ", %EmployeeId);
While &sql.Fetch(&strC_Sched_Type)
SQLExec("SELECT XLATLONGNAME from psxlatitem WHERE FIELDNAME = 'C_SCHED_TYPE' AND FIELDVALUE = :1 ", &strC_Sched_Type, &strXLATLONGNAME);
If &SEQ_NUM < 10 Then
&FLD.AddDropDownItem(&strC_Sched_Type, "0" | &SEQ_NUM | "." | &strXLATLONGNAME);
Else
&FLD.AddDropDownItem(&strC_Sched_Type, &SEQ_NUM | "." | &strXLATLONGNAME);
End-If;
&SEQ_NUM = &SEQ_NUM + 1;
End-While;
Else
&FLD.AddDropDownItem("", "");
End-If;