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)

Show/Hide button on the base of status using Ribbon Workbench

(0) ShareShare
ReportReport
Posted on by 3,634

I've a custom button and a system button, and by using Ribbon workbench I want to show custom button when the form is inactive state and show system button when the form is in 'active' state. I am using following ValueRule step in Display Rule but it doesn't seem to work or I am missing something in between?

Display-Rule.JPG

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Show/Hide button on the base of status using Ribbon Workbench

    For Custom Button Display Rule make statecode value = 1 and For Standard Button Display Rule make statecode value = 0

  • Suggested answer
    Abdul Wahab Profile Picture
    12,119 Moderator on at
    RE: Show/Hide button on the base of status using Ribbon Workbench

    Hi Mohsin

    Could you use this line 'Xrm.Page.ui.refreshRibbon();' on 'On-Load' event?

    Thank You

  • Mohsin Ali Profile Picture
    3,634 on at
    RE: Show/Hide button on the base of status using Ribbon Workbench

    I set value 1 for custom button and 0 for system button. Also, I am already refreshing the ribbon, but it is displaying both button in the ribbon

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Show/Hide button on the base of status using Ribbon Workbench

    Make Default value to null

  • Suggested answer
    Nithya Gopinath Profile Picture
    17,078 on at
    RE: Show/Hide button on the base of status using Ribbon Workbench

    Hi Mohsin Ali,

    You can write a Form State Rule in Display Rules to achieve this functionality.

    See this thread: https://community.dynamics.com/.../153867

    Hope this helps.

  • Mohsin Ali Profile Picture
    3,634 on at
    RE: Show/Hide button on the base of status using Ribbon Workbench

    I tried to use Form State in Display Rule and set the form state as 'Disabled' and 'Read only' for the button that I want to show on inactive records but it hide the button and not show on any form.

  • Verified answer
    Mohsin Ali Profile Picture
    3,634 on at
    RE: Show/Hide button on the base of status using Ribbon Workbench

    The form state rule is a little confusing. But I used it and I am done with my tasks. Thanks every one.

    For understanding Form State Rule, Referred: msdn.microsoft.com/.../gg334563.aspx

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Show/Hide button on the base of status using Ribbon Workbench

    For Custom button which is to be displayed when record is deactivated, use this Value Rule:

    5468.1.PNG

    For Standard Button which is to be displayed when record is Active, use this FormStateRule:

    5468.1.PNG

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