Skip to main content

Notifications

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,618

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

  • 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

  • Verified answer
    Mohsin Ali Profile Picture
    3,618 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

  • Mohsin Ali Profile Picture
    3,618 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.

  • 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.

  • 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

  • Mohsin Ali Profile Picture
    3,618 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
    Abdul Wahab Profile Picture
    12,085 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

  • 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

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May 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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
dkrishna Profile Picture

dkrishna 6

Featured topics

Product updates

Dynamics 365 release plans