Recently, I’ve came accross situation, that despite the fact that certain field has been change on CRM form, a javascrift flag getIsDirty() == false. I’ve noticed that just after changing field value user is clicking ribbon button and that was the reason. Flag getIsDirty() is beeing set when form control loose focus – operating on ribbon immidietly after control value change doesn’t loose focus. In that situation it is good to force last used control on form to blur()
BlurFocusForCurrentControl: function () { var currentControl = Xrm.Page.ui.getCurrentControl(); if (currentControl == null) return; var element = document.getElementById(currentControl.getName()); element.blur(); },