i was asked to disable modifications (inserts and deletes included) to the table from user interface (i named it GUI here) and allow changes to be made only from the programming code ( in reports codeunits etc).
I have heard one could utilize CurrfieldNo variable to distinguish between two . Is it correct ? Is this method used ? I find it to be a bad idea and would prefer to use set-access functions in table object and disable any modifications by deafault - whoever wants to modify the table will have to use set-access functions.
0
Comments
Only give users indirect access to tables.
Very strange request though. Are you creating some sort of archive for your users?
1) Modify all forms working with the table and set EDITABLE to no (or property AllowInsert, AllowDelete, AllowModify) - it is working for all users and it means the SUPER user is not allowed to change the data through forms too
2) Assign just indirect permissions to the users for insert/delete/modify and add permissions into the object properties of the codeunit/report which are changing the data. - you can set the permissions just for some set of users and allow others to edit what they want
3) Make a special set of forms for the limited users and use way no. 1 for them. But you need to do changes everywhere the forms are called...
For me the way 2 looks like best one... ;-)
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
From GUI, users could not set this variable, but you can do it with the SetModifyAllowed function.
The other solution could be, to add an ERROR('') to the OnInsert, etc. triggers, and from CAL you can call INSERT(FALSE), but it only works, if you have no necessary funcions implented in these triggers.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.