Created
March 1, 2022 20:32
-
-
Save melamriD365/c44fe4afabd0adc62fe2a4b4e0f89849 to your computer and use it in GitHub Desktop.
OnChange events always called twice after new record creation (Good Practice)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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