When you want to make some updates in CRM on the entity form like set certain values
or do some computation, two events you can rely on is onLoad and onSave.
What if users don't want to press a button, say Save, especially in the case of a record of a related entity being added or created with the entity of which form you have opened, there is no way to track the updated in number of records being added or removed from the related entity, what you do then other than OnSave ?
Classic javascript has the answer, like any other webform, you get standard window events like onload, onunload: which is the event to be called when you close the window, i.e click on the rightmost cross button [X] at anytime, and also onblur: which is when you move on the another window or just go to desktop loosing the focus of the active window which is the MS CRM form.
So you can run some javascript code on these events by defining a custom handler function for these events which would not be handled by default and have the value null.
This is done in the onLoad event of the MSCRM form:
Comments