I am often met with the question: “How can I hide fields from some users and not for others?”.
Microsoft introduced a functionality with Dynamics NAV 2015 called AccessByPermission.
It enables developers to show or hide fields based on the permissions of an unrelated table.
This is how it works:
I have created a user: Susan
She has these permissions:
Testing her permissions, I log in as Susan:
This is a useful little trick
Logged on as SUSAN my Item card already looks different:
Somehow my Overhead Rate field has disappeared. We can look into that right away.
Switch to the Development Environment and design the Item card (30):
This means that unless I have permission to modify a Production Order, I will not be able to see the field.
I can utilize this for my purpose.
First, let us check which permissions Susan have:
We can see that the basic permission set do not have access to modify the Sales & Receivable Setup.
Now we can use that for susan and all others that do not have permission to modify table 311.
…and I do the same for all the cost price fields:
Now the Item Card will look like this when Susan logs on to Dynamics NAV:
Of course this will only work if the NAV server instance has been setup to utilize this: