I am trying to limit users to only be able to modify SKU's that pertain to them.
I tried the following to make it work:
1. Adding a field on the User Setup table and assign a default location to each user.
2. Adding the following code on the OnModify trigger of the Stockkeping Unit table:
UserSetup.GET(USERID);
UserSetup.TESTFIELD("UserLocation", SkuLocation."Location");
I am not a Nav programmer but I am trying to compare the default user location to the location on the SKU - if it is the same, then allow changes to the record.
Thanks in advance for any suggestions how to make this work?
0
Comments
UserSetup.GET(USERID);
TESTFIELD(Location,UserSetup."UserLocation");
or how about
UserSetup.GET(USERID);
If Location <> Usersetup."UserLocation"
Then ERROR('User %1 is not allowed to change this Particular Location',UserSetup."User ID");
We don't use Stockkeping Unit table so if it's a specific field they are changing I would put it on the Onvalidate of the particular field. Either way give it a try.
http://www.BiloBeauty.com
http://www.autismspeaks.org
Check how the Responsibility Center works or search FILTERGROUP on the help file or on this forum.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book