10 Jun’17

D365 Business CentralTo restrict an action button to a particular user in NAV 2017

Introduction:

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

Pre-requisites:

Microsoft Dynamics NAV 2017

Steps:

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.

Written by

Chris D'Silva

Software Developer

2 thoughts on “To restrict an action button to a particular user in NAV 2017”

  1. Hello Katja,

    Thanks for your feedback.

    I have used Boolean filtering because I have to filter only those users with a check on “CEO” field. However, you can use any SETRANGE for filtering.

    – Chris D’Silva

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Reading more then 10K records in D3FOE OData API

    11 July’ 2018

    Introduction: We all know Dynamics 365 Finance and Operations has limitation of 10K records to be fetched at a time usi...

    Read more
  • Paging in D365 Customer Engagement v9.0

    10 July’ 2018

    Introduction: The Xrm.retrieveMultipleRecords method is used to retrieve a collection of records in Dynamics 365 Custom...

    Read more
  • Set up Dynamics 365 connection in Microsoft Social Engagement

    10 July’ 2018

    Introduction: This blog explains how to Set up Dynamics 365 connection in Microsoft Social Engagement. Steps to be follo...

    Read more
  • Voice of the Customer failed to install

    10 July’ 2018

    Introduction: Many people face issues in installing Voice of Customer solution on v9 environment and trying repeatedly ...

    Read more
  • Scribe Insight AX as a Web Service Find Block issue

    10 July’ 2018

    Introduction: If we need to look up for any value from AX then we do it by using a Find Block in Scribe Insight Eg: Basi...

    Read more