Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

How to hide button in ribbon workbench based on toggle yes/no if open form is unsaved

(0) ShareShare
ReportReport
Posted on by
I have a requirement to hide a button in the ribbon based on toggle (yes/no) if the form is unsaved. 
 
When the toggle is set as Yes, Cancel button is appear, and vice versa.
 
 
Do I need to make use of RefreshRibbon somewhere to pick up the new rules?. If so where can I use this so it gets fired? 
 
function checkUnsavedChanges(primaryControl)
{
return Xrm.Page.data.entity.getIsDirty();
}
  • Verified answer
    Dengliang Li Profile Picture
    Dengliang Li Microsoft Employee on at
    How to hide button in ribbon workbench based on toggle yes/no if open form is unsaved
    Hi,
     
    I'm afraid this can't be done.
    Microsoft does not provide an API for the form data change event. Unable to trigger JavaScript on form Unsaved.

    Best Regards,
    Dengliang Li
     

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans