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)

Ribbon Workbench: Display rule works, Enable rule doesn't

(0) ShareShare
ReportReport
Posted on by 2

I want to show/hide a ribbon button based on the value of a tickbox on the form.  Using the Ribbon Workbench, I've used a Display Value Rule and it works perfectly.  When I replicate the logic exactly using an Enable Value Rule it doesn't work.  I've double-checked that the Rules are linked to the button via Commands correctly.

Any ideas why this might be?

(BTW, the reason I can't just stick with the Display Rule is because this is a test for what I actually want to do, which is call a custom JavaScript function, which you can't do with Display Rules).

*This post is locked for comments

I have the same question (0)
  • ScheumanRJ Profile Picture
    76 on at
    RE: Ribbon Workbench: Display rule works, Enable rule doesn't

    In case it help someone else that finds this thread....

  • Loz Profile Picture
    2 on at
    RE: Ribbon Workbench: Display rule works, Enable rule doesn't

    Removing the Display rule seemed to do the trick, the Enable Rule started working.  So it seems like having both rules in place in the Ribbon Workbench - even if you're just calling one of them with a Command - causes problems.  Thanks Aric, and also Erik who suggested trying the same thing.

  • Verified answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at
    RE: Ribbon Workbench: Display rule works, Enable rule doesn't

    Try remove the display rule from your code.

    Also, just for test purpose, remove the values from the Default and InvertResult.

    Keep it only with Value Rule and the javascript library/function and see what results you are getting.

  • Loz Profile Picture
    2 on at
    RE: Ribbon Workbench: Display rule works, Enable rule doesn't

    My code was even simpler still:

    return false;

    Then I just manually changed it to test, still didn't work.  I don't think it's a code issue though, that's why I've boiled it down to this Value Rule test.  Seems like Enable Rules just aren't working for me for some reason.

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: Ribbon Workbench: Display rule works, Enable rule doesn't

    Hi Loz,

    Can you please validate with below article what you did.

    garethtuckercrm.com/.../dynamically-disable-ribbon-buttons-in-dynamics-crm

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: Ribbon Workbench: Display rule works, Enable rule doesn't

    Hi Loz,

    Can you please validate with below article what you did.

    https://garethtuckercrm.com/2013/11/25/dynamically-disable-ribbon-buttons-in-dynamics-crm/

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Ribbon Workbench: Display rule works, Enable rule doesn't

    I've never had a problem using a custom javascript on enable rule (solely) to show/hide a ribbon button.

    Was the code very intricate?

    I usually do something like:

    var returnvalue = false;

    if (something something)

    returnvalue = true;

    return returnvalue;

    or some such.

    I don't know why Display rule would work while Enable rule wouldn't, sorry.

  • Loz Profile Picture
    2 on at
    RE: Ribbon Workbench: Display rule works, Enable rule doesn't

    Yes, this is where I started, calling a javascript function from an Enable Rule.  It didn't work, so I gradually worked backwards with simpler and simpler tests.  This was the simplest test I could come up with, just using an identical Value Rule.  Works perfectly as a Display Rule, doesn't work at all as an Enable Rule.

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Ribbon Workbench: Display rule works, Enable rule doesn't

    I believe EnableRule shows/hides just as well as Display Rule. Have you tried using just Enable Rule?

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: Ribbon Workbench: Display rule works, Enable rule doesn't

    Hello Loz,

    Can you please check this article , hope you will get help from here.

    garethtuckercrm.com/.../dynamically-disable-ribbon-buttons-in-dynamics-crm

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#2
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans