Dynamics NAVTo restrict an action button to a particular user in NAV 2017
This article focuses on how to restrict other users and allow only a particular user to user a specified action button in a Page in NAV 2017.
The requirement was such that the page Purchase quote is to be signed off by the CEO and then Purchase order is created. Here, an action button is created called Sign off, where on click of the button, the boolean field called Sign off which is an un-editable field is enabled. Only the CEO should have the access to Sign off the Purchase Quote. The other users should be restricted from signing off the Purchase Quote
Microsoft Dynamics NAV 2017
1. In the NAV Development Environment, create a Boolean field. e.g CEO in the User Setup table.
2. Add this field to the User setup page and enable this field for the CEO user.
3. Create a button Sign off in the purchase quote. Create a new codeunit and subscribe it to the action button Sign off.
4. Create a global variable User Setup in the codeunit and refer the below code.
5. In the Windows client/Web Client, browse to Purchase Quote from the search bar.
6. Edit any Purchase Quote and click on Sign off. Here if the User is not the CEO, in the above image the user is OETIADMIN ,a message is displayed ‘Only the CEO can Sign off this purchase document’
7. If the User is the authorize user to sign off in this case the CEO then the message is displayed as Purchase Quote is signed off.