Hi,
I am using isDirty method to detect all changes on a Form in Dyn365 made by a user.
I can use var dataXml = formContext.data.entity.getDataXml(listofDirtyAttributes) to get a list of dirty fields in XML format.
My fist question is. How do I detect optionset and lookup fields while getting all dirty fields?
Second question.
Is it possible to get Label(Display Name) of fields.
Here is a function I use.
if (formAttributes != null) {
for (var i in formAttributes) {
if (formAttributes[i].getIsDirty()) {
listofDirtyAttributes += formAttributes[i].getName() + "\n";
formAttributes[i].controls.forEach(
control => control.addNotification({
messages: ['Changed'],
notificationLevel: 'RECOMMENDATION'
})
);
}
}
}
Thank you.