Skip to content

Instantly share code, notes, and snippets.

@melamriD365
Last active March 2, 2022 11:43
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/36adf6939002846d277e6dc63ae31fbe to your computer and use it in GitHub Desktop.
Save melamriD365/36adf6939002846d277e6dc63ae31fbe to your computer and use it in GitHub Desktop.
OnChange events always called twice after new record creation (Bad Practice)
var MEA = window.MEA || {};
var accountForm = MEA.accountForm || {};
(function () {
this.OnLoad = function (onLoadContext) {
console.log("onLoad ....");
var formContext = onLoadContext.getFormContext();
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