{Power 2021} Trigger on save notification only when certain fields change in Model driven App

User Review
0 (0 votes)

Business Requirement: Show notification in model driven form on save of table only when particular field/attribute has changed.


Solution: In Dynamics 365 , we can achieve this requirement using following script:

// function to show notitification on save
function onSave(executionContext) {
var formContext = executionContext.getFormContext();
var field = formContext.getAttribute(“fieldname”);
if (field.getValue() == VALUETOMATCH && field.getIsDirty())
var message = “Field name has changed”;
var messageString =
confirmButtonLabel: “Ok”,
text: message

var messageAlertOption =
height: 120,
width: 260

Xrm.Navigation.openAlertDialog(messageString, messageAlertOption);

Register this on save and show alerts based on field changed.

Hope it helps and Power 365ing as usual!

Other ways to learn with me:


Any problem in Power Platform or Dynamics 365 – end user, Microsoft partner or an individual?

Problem Area – Technical, Functional, Training, Development or consulting?

Me and my team are here to help, get in touch here: Click here