Skip to content

Instantly share code, notes, and snippets.

@melamriD365
Created March 1, 2022 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save melamriD365/c44fe4afabd0adc62fe2a4b4e0f89849 to your computer and use it in GitHub Desktop.
Save melamriD365/c44fe4afabd0adc62fe2a4b4e0f89849 to your computer and use it in GitHub Desktop.
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