Hi All :
We had a wrapper written on Item Planning Maintenance program to restrict users not belonging to a certain group (User Group) not to update Supplier field (ptp_vend). The program works fine when the user not belonging to that User group try to enter / modify the data, but if he does a lookup (pressing "F2" function key), he was able to update the field.
Any help as how I could restrict the user not to update from the lookup will be greatly appreciated.
Find below the code snippet :
if self:name = "ptp_vend" then do:
find first code_mstr no-lock where
/*PICSDCONV*/ code_mstr.code_domain = global_domain and
code_fldname = "pm_secure"
no-error.
if available code_mstr then do:
find usr_mstr no-lock where usr_userid = global_userid
no-error.
if available usr_mstr then do:
g-list = ''.
for each usrgd_det no-lock where usrgd_userid = global_userid,
each usrg_mstr no-lock where
usrg_mstr.oid_usrg_mstr = usrgd_det.oid_usrg_mstr:
if length(g-list) > 0
then g-list = g-list + "," + usrg_group_name.
else g-list = usrg_group_name.
end.
if lookup(code_value,g-list) = 0 then do:
message "ERROR: Access to this field denied."
self:screen-value = a-vend.
end.
Regards,
Ramamurthy Dasari
We had a wrapper written on Item Planning Maintenance program to restrict users not belonging to a certain group (User Group) not to update Supplier field (ptp_vend). The program works fine when the user not belonging to that User group try to enter / modify the data, but if he does a lookup (pressing "F2" function key), he was able to update the field.
Any help as how I could restrict the user not to update from the lookup will be greatly appreciated.
Find below the code snippet :
if self:name = "ptp_vend" then do:
find first code_mstr no-lock where
/*PICSDCONV*/ code_mstr.code_domain = global_domain and
code_fldname = "pm_secure"
no-error.
if available code_mstr then do:
find usr_mstr no-lock where usr_userid = global_userid
no-error.
if available usr_mstr then do:
g-list = ''.
for each usrgd_det no-lock where usrgd_userid = global_userid,
each usrg_mstr no-lock where
usrg_mstr.oid_usrg_mstr = usrgd_det.oid_usrg_mstr:
if length(g-list) > 0
then g-list = g-list + "," + usrg_group_name.
else g-list = usrg_group_name.
end.
if lookup(code_value,g-list) = 0 then do:
message "ERROR: Access to this field denied."
self:screen-value = a-vend.
end.
Regards,
Ramamurthy Dasari