fireOnChange does not fire dynamics crm 2011
dynamics-crm-2011, javascript
Solution
Try this:
Xrm.Page.getAttribute("mobilephone").addOnChange(this.mobilephone_OnChange);
depending on how you've structured your js file, "this" maybe the name of your js class.
Also note that if you update the field programmatically in Javascript, the onChange event will not fire automatically. (But can be via FireOnChange())
Problem
I have a javascript webresource in a crm2011 Contact form. Under the form properties of the form, i added the `Form_onload()` function below to the OnLoad event handler. When i debug it, i can see that the `Form_onload(`) method is being fired and executed. However, when I try to edit the mobilePhone number and i click out of the field, i get nothing. When i debug, the breakpoint inside the `mobilephone_OnChange()` method is not hit, it simply does not do a thing. ``` function Form_onload() { Xrm.Page.getAttribute("mobilephone").fireOnChange(); } function mobilephone_OnChange() { alert("fire away"); } ``` All what I want to do is, get the little alert inside the `mobilephone_OnChange()` function. I seriously dont know what to do anymore. I've read tons of articles stating that `.fireOnChange()` will automatically wire up all OnChange events that are declared. However, this doesn't seem to work.