Limiting User access to a SKU location?
rstols
Member Posts: 28
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?
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
-
rstols wrote: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?
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.0 -
Instead of giving error messages, why not just filter out the locations you do not want them to see?
Check how the Responsibility Center works or search FILTERGROUP on the help file or on this forum.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
Thank you, it's now working fine.0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions