web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Ribbon Workbench Woes

(0) ShareShare
ReportReport
Posted on by 173

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. 

1638.ribbonworkbench.PNG

Does anyone have a sample or a link that works.

I am using Dynamics 365 online.

I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,985 Moderator on at

    Hi,

    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 .

    ribbonworkbench.uservoice.com/.../896958-smart-buttons

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • myintuition Profile Picture
    173 on at

    Thankyou so much.  I contacted support

  • Suggested answer
    Vipin J Profile Picture
    1,603 on at

    Hi,

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

    https://vjcity.blogspot.com/2020/06/how-to-get-security-role-of-logged-in.html

    https://vjcity.blogspot.com/2019/08/how-to-check-if-current-user-has.html

    Custom Button via Ribbon Workbench - https://vjcity.blogspot.com/2021/04/reopen-closed-activity-in-dynamic-365.html

  • anavrin Profile Picture
    40 on at

    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 (item.name === "security role") {

                   //match found set return value to true

                   retVal = true;

               };

           });

           return retVal;

       },

    hope it helps

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

#2
ManoVerse Profile Picture

ManoVerse 62 Super User 2026 Season 1

#3
11manish Profile Picture

11manish 43

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans