This article discusses how to display a custom ribbon button only when a form has no unsaved changes in a model-driven app. The article covers both the Classic Ribbon and Modern Commanding extension models. For the Classic Ribbon, the form's state can be checked using the `formContext.data.entity.getIsDirty()` method, and a JavaScript function can be created to determine whether the button should be shown or not. The button's enable rule can then be configured in the Ribbon Workbench. For the Modern Commanding model, the visibility rule can be expressed using the PowerFx expression `Not(Self.Selected.Unsaved)`. The article also provides a solution for refreshing the ribbon on form change.
Login now to access my digest by 365.Training