How to hide cost prices from some users in Dynamics NAV

HidePrices

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

image

 

She has these permissions:

image

 

Testing her permissions, I log in as Susan:

image

This is a useful little trick Smiley

 

Logged on as SUSAN my Item card already looks different:

image

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):

image

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:

image

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.

image

 

…and I do the same for all the cost price fields:

image

 

Now the Item Card will look like this when Susan logs on to Dynamics NAV:

image

 

Of course this will only work if the NAV server instance has  been setup to utilize this:

image

 

Happy hiding Smiley

 

image393333333

Anonymous
Related