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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Answered

Ribbon Button Visibility Control

(0) ShareShare
ReportReport
Posted on by 360

Hello Community,

I have a custom entity. I added 2 custom buttons. I added display rule but I think so this is not run right.  I want to do when two buttons appear at the onload of the form. After the form is saved, if the job started, "Job Start", if the job done, "Jobe Done" button to hide. So while one button is visible, the other is invisible. 

pastedimage1610024356598v2.png

Please help this subject to me.
Thanks/Regars.
I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Onur,

    1..Add refresh javascript code to the job field onChange event.

    (1)Js code:

    function refreshRibbonOnChange() {
       Xrm.Page.ui.refreshRibbon();
    }

    (2)Add js as web resource.

    Go Settings > Customizations > Customize the system > Web Resource.

    pastedimage1610073933501v1.png

    (2) Add it to the field onChange event.

    Go Settings > Customizations > Customize the system > entities > entity you need > forms to open main form, then click 'Form Properties'.

    pastedimage1610074345229v3.png

    pastedimage1610074316383v2.png

    if you want to show changed after clicking save button, you can add it to the onSave button.

    pastedimage1610078657032v2.png

    2.You need do following settings in ribbon workbench.

    (1) Set Job Start button.

    pastedimage1610078539524v1.png

    (2) Set Job Done button.

    pastedimage1610078236960v9.png

    3.Test.

    (1)Job field is null.

    pastedimage1610075705874v4.png

    (2)Job field is not null.

    pastedimage1610075855874v7.png    pastedimage1610075759110v6.png

     

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • onurizgi Profile Picture
    360 on at

    Hi Leah,

    Thank you so much for your good explanation. I think so I skipped a point :(

    My 2 fields are two options type. Both of us default value false. So they cannot be empty. I tried all the your stages. Both buttons are hidden. I share what I have done below. Can you fix it if I did it wrong? I'll be glad, if you help me :)

    1. I added your shared script 

    pastedimage1610084436165v1.png

    2. I added function jobstarted field onchange 

    pastedimage1610084499191v2.png

    3. I added onsave

    pastedimage1610084528753v3.png

    4. Create display rules for Job Start Button

    pastedimage1610085979388v5.png

    pastedimage1610086024064v6.png

    5. Create display rules for Job Done Button

    pastedimage1610086088526v7.png

    pastedimage1610086130635v8.png

    6. I was tried.

    pastedimage1610086215493v10.png

    So thanks.

  • Verified answer
    Community Member Profile Picture
    on at

    Hi Onur,

    As your screenshot shown, you have two field to control two buttons Separately, you can set them like following screenshot.

    For JobStart button:

    pastedimage1610100275939v1.png

    For JobDone button:

    pastedimage1610100356514v2.png

    And just add refersh js code to onSave event.

    Test:

    when field value is yes, the button can show, if it is no, the button will be hidden.

    pastedimage1610100438682v3.png

    if you still can't achieve it.

    1.you can move button to the front of the bar.

    pastedimage1610100636459v5.png

    2.you can try to use 'value rule' of  'enable rule' to test again.

    pastedimage1610100622224v4.png

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • onurizgi Profile Picture
    360 on at

    Hi Leah,

    Greate, resolved! Thank you so much

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 73 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 42 Most Valuable Professional

#3
Scott Jackson UK Profile Picture

Scott Jackson UK 22

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans