Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
OnChange events always called twice after new record creation (Good Practice)
var MEA = window.MEA || {};
var accountForm = MEA.accountForm || {};
(function () {
this.OnLoad = function (onLoadContext) {
console.log("onLoad ....");
var eventArgs = onLoadContext.getEventArgs();
var formContext = onLoadContext.getFormContext();
if (eventArgs.getDataLoadState() == 1) {
formContext.getAttribute('telephone1').addOnChange(this.OnChangeHandler);
}
};
this.OnChangeHandler = function (onChangeContext) {
console.log("The field is changed...")
};
}).call(accountForm);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment