I need only specific user to update the sales price.In the user setup table i have created a boolean .only the person with that boolean tick can update the sales price.how to write c/al code for this?
thanks
gugan
CheckCustPermission(UserName : Code[50])
WITH UserSetup DO BEGIN
SETRANGE("User ID",UserName);
IF (NOT FINDFIRST) OR (NOT "Allow Modifying Customer") THEN ERROR(NoPerm);
END;
It is NAV2017 so it is called from an event subscriber codeunit, but in an older version you would have to call it from the table triggers.
CheckCustPermission(UserName : Code[50])
WITH UserSetup DO BEGIN
SETRANGE("User ID",UserName);
IF (NOT FINDFIRST) OR (NOT "Allow Modifying Customer") THEN ERROR(NoPerm);
END;
It is NAV2017 so it is called from an event subscriber codeunit, but in an older version you would have to call it from the table triggers.
Answers
CheckCustPermission(UserName : Code[50])
WITH UserSetup DO BEGIN
SETRANGE("User ID",UserName);
IF (NOT FINDFIRST) OR (NOT "Allow Modifying Customer") THEN ERROR(NoPerm);
END;
It is NAV2017 so it is called from an event subscriber codeunit, but in an older version you would have to call it from the table triggers.