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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Hide or Show a ribbon button using javascript based on certain conditions

(0) ShareShare
ReportReport
Posted on by 550

Hi,

Are there any APIs present to hide or show ribbon buttons using javascript based on certain conditions like , the ribbon button must be visible only when an account field is selected and has an value ?

Thanks ,

Hajira

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Guido Preite Profile Picture
    54,084 Moderator on at
    RE: Hide or Show a ribbon button using javascript based on certain conditions

    what do you mean by "selected"?

    if you want to show/hide a ribbon button based on a field's value you can do without code, just editing the displayrule or the enablerule of the ribbon adding a ValueRule

    if you mean change the ribbon when the user is hover a specific field, that is not possible

  • HajiraRoshan Profile Picture
    550 on at
    RE: Hide or Show a ribbon button using javascript based on certain conditions

    Hello Guido,

    I have to make  ribbon button visible only when the account lookup field has a value. I am trying to create a ribbon button in contact form.

    Then, I need to add a javascript to the ribbon button , and make it run when the button is clicked ..

    Thanks in advance,

    Hajira

  • Verified answer
    Guido Preite Profile Picture
    54,084 Moderator on at
    RE: Hide or Show a ribbon button using javascript based on certain conditions

    then you can create the ribbon button with Ribbon Workbench, set the visibility based on a ValueRule and make it execute your custom javascript

    ribbonworkbench.uservoice.com/.../121427-enable-disable-a-ribbon-button-dynamically-based-o

    and this to give you an idea how to connect javascript

    ribbonworkbench.uservoice.com/.../129783-pass-the-currently-selected-grid-row-s-to-a-custo

  • Verified answer
    Hemant Kumar Sahu Profile Picture
    1,829 on at
    RE: Hide or Show a ribbon button using javascript based on certain conditions

    There is similar example this may helps you.

    community.dynamics.com/.../how-to-disable-a-crm-2016-ribbon-button-based-on-form-name

    Hemant

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans