Hi --
I was hoping someone could shed some light on how the form scripting & web resources work under the covers. I have some code that runs on the form for a custom entity using JS and HTML web resources. I run a function called kickOff on save of the form. This function call is configured in the form properties of my custom entity. In my code I have a global variable that is a boolean, intended to be switched after the on save code runs. Initally, my kickOff checked the value of my global, ran my code if "false" & returned if "true."
The trouble was that my kickOff function was not registering, for lack of a better word, the changed value of the global variable. After a lot of trial and error I moved my condition check to a function called in kickOff. When the condition check was moved here, the global behaved as expected.
Why would I experience this behavior? What is it about the way dynamics uses the functions called in the event handler form configuration that would cause this? I am just trying to make sure I understand how dynamics interacts with the javascript I write.
Thanks very much for any help.