Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

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

Posted on by 3,610

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
    Community Member Microsoft Employee 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
    Mohsin Ali 3,610 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
    Mohsin Ali 3,610 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
    Nithya Gopinath 17,074 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
    Community Member Microsoft Employee on at
    RE: Show/Hide button on the base of status using Ribbon Workbench

    Make Default value to null

  • Mohsin Ali Profile Picture
    Mohsin Ali 3,610 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
    Abdul Wahab 12,070 Super User 2024 Season 1 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
    Community Member Microsoft Employee 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans