Skip to main content
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested answer

Where/How to add JavaScript code in Ribbon Workbench?

(0) ShareShare
ReportReport
Posted on by 5

Hi,

We need to hide Activate/Deactivate button depending on the security role/team of the user.  Where/How in Ribbon workbench can I insert a code to that?

Thank you.

  • Suggested answer
    Varsha deshpande Profile Picture
    135 on at
    RE: Where/How to add JavaScript code in Ribbon Workbench?

    Hi,

    Please create a web resource of type JavaScript and add an enable rule for hiding the button.

  • Suggested answer
    Pawar Pravin  Profile Picture
    5,237 on at
    RE: Where/How to add JavaScript code in Ribbon Workbench?

    Please refer below url for reference:

    pravinpawarweb.wordpress.com/.../

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Where/How to add JavaScript code in Ribbon Workbench?

    Hi Chesca,

    Please follow the steps:

    1. Create a web resource which type is Jscript(your code).

    2. Right click button and click customise button command:

    Snipaste_5F00_2022_2D00_01_2D00_31_5F00_08_2D00_58_2D00_36.png

    3. Add an Enable rule and add a custom rule step( Library is your web resource in step1. Function Name is the function name in your code):

    Snipaste_5F00_2022_2D00_01_2D00_31_5F00_09_2D00_00_2D00_35.png

    4. Add the Enable rule(Created in step3) to the command:

    Snipaste_5F00_2022_2D00_01_2D00_31_5F00_09_2D00_08_2D00_25.png

    5. Publish it.

    Reference:

    d365demystified.com/.../

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 51 Most Valuable Professional

#2
Ramesh Kumar Profile Picture

Ramesh Kumar 42

#3
David Shaw_UK Profile Picture

David Shaw_UK 27

Featured topics

Product updates

Dynamics 365 release plans