I want to allow only one user full read/write permission to the Vendor Card. All other users can only have read permissions to the info. conatined in the vendor card. What is the most elegant solution to this problem?
Permissions in Navision is something I'm not too clear on...
Thanx in advance!
0
Comments
Standard Nav has two roles (P&P-VENDOR and P&P-VENDOR, EDIT) that you can assign to your users and will do the job.
* P&P-VENDOR is for reading
* P&P-VENDOR, EDIT is for read/write
In case you don't have those roles, then restore a Cronus and study how are those roles where made regarding the Vendor table.
Arhontis
https://forum.mibuso.com/search
OnModify()
IF (USERID <> 'GERRY') AND (USERID <> 'ADMIN') THEN
ERROR('You do not have permission to edit this form');
Works ok now.
Thanx!
In that case you can use the following instead: But I strongly recommend not to hardcode like that...
You should avoid modifications when you can use standard functionality...
Arhontis
https://forum.mibuso.com/search
Down the road, coding permissions can be a huge pain to maintain. If at all possible (and its so easy to do in this case) standard Navision permissions should be used. Look at Arhontis' first suggestion.
Furthermore, if you are going code your way out, the standard way of doing this is modifiying the UserSetup table. Create a boolean field that indicated the users have editing rights, and then in the vendor onmodify trigger, check that field to determine what to do next.
Arhontis coding solution is also not recommended because it puts more code on the form. That can be a pain to find, and is becoming less portable with 5.0.
Short answer: don't do it!