Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Hidden an Sales Order action for specific role

Posted on by 465

Hi Community,

Could you help me with this:

I create a new role in BC, but in this case the user that will be working in this role, he will have not permission to Post  sales order, my inquiry is how I can lock or hide this action for specific role and user?

pastedimage1681312119935v1.png

Thank you for your time.

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,565 Super User 2024 Season 2 on at
    RE: Hidden an Sales Order action for specific role

    Hi, If you don't need to set conditions, you can easily remove them by using the Customize Pages function on the Profile page.

    pastedimage1681357081149v1.png

    pastedimage1681357124521v2.png

    Hope this helps.

    Thanks.

    ZHU

  • Suggested answer
    Vaishnavi J Profile Picture
    Vaishnavi J 3,056 on at
    RE: Hidden an Sales Order action for specific role

    Hi

    In your User Setup page create a boolean field called as IsAccessible and after creating that field in User Setup table and page extension.

    Then in the Business Central User Setup page just select this boolean to be true whichever user needs to be shown the post action.

    If my answer was helpful to you, please verify it so that other users know it worked. Thank you very much.

  • Manuel Lozada Profile Picture
    Manuel Lozada 465 on at
    RE: Hidden an Sales Order action for specific role

    Hi Vaishnavi,

    I try follow your instructions but "User Setup" does not contain a definition for IsAccessible because is a global variable.

    Could you said me how I can fixing and how assigned the user.

    thank you

    IsAccessible:= Rec_User.IsAccessible;

  • Suggested answer
    Vaishnavi J Profile Picture
    Vaishnavi J 3,056 on at
    RE: Hidden an Sales Order action for specific role

    Hi,

    You can create a boolean in user setup page and whenever the boolean is true then in your onopen page trigger use the below logic of sales order card page extension

    Var IsAccessible: boolean // declare a global variable

    //To get the user and which user is able to see post action

     trigger OnOpenPage()
        var
            Rec_User: Record "User Setup";
     
     begin
    IsAccessible:=false;
            Clear(Rec_User);
            Rec_User.Reset();
      Rec_User.SetRange("User ID", UserId);
            if Rec_User.FindFirst() then begin
                IsAccessible:= Rec_User.IsAccessible;  // if the IsAccessible value is true meaning that user is able to see Post action
    end;
     
    //write the code in sales order card page extension
    Modify
    {
    Action(Post)
    {
    visible=IsAccessible;  
    }
    }
    If my answer was helpful to you, please verify it so that other users know it worked. Thank you very much.
  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,137 Super User 2024 Season 2 on at
    RE: Hidden an Sales Order action for specific role

    You can achieve it with the permission sets by removing access to the post.

    pastedimage1681312440007v1.png

    Or you can go to the profiles and customize the sales order page to hide the post actions.

    pastedimage1681312497341v2.png

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