This function will return an array of fields which are currently modified by not saved on a form in Dynamics 365 CE/CRM
function CheckDirtyFieldsOnForm(executionContext)
{
formContext = executionContext.getFormContext();
var attributes = formContext.data.entity.attributes.get();
var dirtyAttributes = [];
if (attributes != null) {
for (var i in attributes) {
if (attributes[i].getIsDirty()) {
dirtyAttributes.push(attributes[i].getName());
}
}
}
return dirtyAttributes;
}
No comment yet, add your voice below!