Skip to main content



No record found.

Microsoft Dynamics CRM forum
Suggested answer

Ribbon Workbench Woes

Posted on by 167

I have a smart button "Run Webhook".  It works great and it runs on the Home Main Tab (the first option).  If I select one or many records on the grid it loops through them and works on all records.  I used a webhook as it is calling a power automate flow.

My issue is, I want to limit the access to this button to a security role, or on the view name.  Either would work.

I have been going through everything I can find, I cannot seem to get anything to work.

I think it is because it has to run on the Home Main Tab(the first option).

Or maybe because it is a smart button. 


Does anyone have a sample or a link that works.

I am using Dynamics 365 online.

  • anavrin Profile Picture
    anavrin 40 on at
    RE: Ribbon Workbench Woes

    this code works for me

    CheckUserSecurityRoleAccess: function () {

           var retVal = false;

           var globalContext = Xrm.Utility.getGlobalContext();

           //get the rolesArray

           var userRoles = globalContext.userSettings.roles;

           //initialize return value

           var hasRole = false;

           //foeach item in array

           userRoles.forEach(function hasRoleName(item, index) {

               //Check passed in value for role[].name match

               if ( === "security role") {

                   //match found set return value to true

                   retVal = true;



           return retVal;


    hope it helps

  • Suggested answer
    Vipin J Profile Picture
    Vipin J 1,582 on at
    RE: Ribbon Workbench Woes


    can you not check the security role of a user within Jscript and deny user action. Please refer here

    Custom Button via Ribbon Workbench -

  • myintuition Profile Picture
    myintuition 167 on at
    RE: Ribbon Workbench Woes

    Thankyou so much.  I contacted support

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,960 Super User on at
    RE: Ribbon Workbench Woes


    It is one of the limitation of Smart buttons.

    I would urge you to lodge your request to below ribbon workbench support page to get the reply from creator of the RWT .

    Please mark my answer verified if this is helpful!


    Bipin Kumar

    Follow my Blog:

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .


André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,995 Super User

Martin Dráb Profile Picture

Martin Dráb 225,610 Super User

nmaenpaa Profile Picture

nmaenpaa 101,148


Featured topics

Product updates

Dynamics 365 release plans