Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

how to restrict an action button to a specific user in NAV 2017

Posted on by 4,184

Hi,

I'm having two users the requester and CEO,

I'm using send approval workflow to request the CEO, now CEO logs in and approves the request now the CEO clicks on sign off button which ticks the sign off field in the form.

I want to restrict this button only to be used by the CEO, other users shouldn't be able to use them. 

also the send approval button needs to be restricted only to a specific user

how can I do so.please provide me suggestions.

*This post is locked for comments

  • CDsilva Profile Picture
    CDsilva 4,184 on at
    RE: how to restrict an action button to a specific user in NAV 2017

    Thank you for your suggestions

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: how to restrict an action button to a specific user in NAV 2017

    Chris,

    Either you can use the ROLE assigned to the CEO to disable the action on the page load or add a separate field on the user setup and define who has permissions to that action or not.

    As other members suggested, instead of adding the code control the visibility or enabled option for the action.

    Check this link

    www.archerpoint.com/.../microsoft-dynamics-nav-user-setup-table-and-myth-security

    Thanks

  • Suggested answer
    RockwithNav Profile Picture
    RockwithNav 6,562 on at
    RE: how to restrict an action button to a specific user in NAV 2017

    Hey @Chris D'silva,

    Though it solves your case, I will suggest you to go with visibility option, Why even to show that button to those users who has nothing to do on it.

  • Suggested answer
    Amol Salvi Profile Picture
    Amol Salvi 18,694 on at
    RE: how to restrict an action button to a specific user in NAV 2017

    Rather than doing Hard Coding it is better to do based on parameters.

  • CDsilva Profile Picture
    CDsilva 4,184 on at
    RE: how to restrict an action button to a specific user in NAV 2017

    Hi

    Thanks for your replies.

    I tried this code

    IF USERID = 'CEO' then

    signoff

    else it throws a message

    This too works right.

  • Verified answer
    Binesh Profile Picture
    Binesh 7,885 on at
    RE: how to restrict an action button to a specific user in NAV 2017

    Hello,

    Do as per other member suggested, OR you can also hide that action if you would like,

    for that you have to do same thing and add one boolean variable like: IsVisible and assign this variable to action group of VISIBLE Property.

    and write code in OnINIT trigger

    IF the user is NOT CEO then 

    CLEAR(IsVisible)

    ELSE

    IsVisible := TRUE;

  • Verified answer
    Amol Salvi Profile Picture
    Amol Salvi 18,694 on at
    RE: how to restrict an action button to a specific user in NAV 2017

    With little customization you can do that

    Add one boolean field in User Setup as 'CEO' and on Sign off button check for that field .

    IF the user is NOT CEO then popup error message.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans