Hi,
I have created a menu button in vendor card called 'Calculate Score". I want only user having id 'SB' will be able to calculate the score when the button is pushed. For other users the system will throw authorization error. I have written a code like this:
IF CONFIRM('Do You want to calculate score?',TRUE) THEN BEGIN
GVUserSetup.GET(GVUserSetup."User ID");
IF GVUserSetup.FIND('-') THEN
IF GVUserSetup."User ID"<> 'SB' THEN BEGIN
ERROR('You are not authorized to calculate vendor score');
EXIT;
END;
when i run the card and push the button for all users the error is coming as such "User Setup User ID " does not not exist"
How do i solve it. Plz help.
0
Comments
First line
IF USERID <> 'SB' THEN
ERROR('Errormessage');
This makes sure that if the user is not SB an error occurs
Second line. (Navision will have stopped if the error kicked in)
IF CONFIRM('Do You want to calculate score?',TRUE) THEN
Callcalculation;
Epimatic Corp.
http://www.epimatic.com
RIS Plus, LLC