I can cause all of the calculated fields to refresh by calling the following function:
NWF.FormFiller.Functions.ProcessOnChangeEvents();
Is there any way to execute JavaScript after the refresh is complete?
I can cause all of the calculated fields to refresh by calling the following function:
NWF.FormFiller.Functions.ProcessOnChangeEvents();
Is there any way to execute JavaScript after the refresh is complete?
depends on what exactly you mean with 'form to be refreshed'...
there is a NWF.FormFiller.Events.RegisterAfterReady event handler which is invoked page/form is rendered, seePeople Picker Extensions - Nintex Forms . so you could place your code into it.
however, this handler do wait for asynchronous events, so some controls need not be populated with data yet when handler is invoked (typically lookups).
and there is, unfortunately, no event that would notify all the async events are done.
Thanks that is exactly what I want it to do. I want my code to wait till the lookups are complete.
I am doing a userProfileLookupup
userProfileLookup(ctrlRequestedForID,"Manager")
I want to execute code only after the lookup is complete.
I tried
NWF.FormFiller.Functions.ProcessOnChangeEvents();
NWF.FormFiller.Events.RegisterAfterReady(function () {
alert(NWF$("#" + JS_crtlCalcManager).val());});
But the value in the lookup field is blank or null for the alert but a value does display on the form. So it looks like the code is running before the lookup is complete.
the only way I'm aware of how to achieve that is to delay execution of your function by some timeout with setTimeout() javascript function. but it's just best guessed delay. in most cases it might work, but if for some reasons refresh is delayed your function might still be executed too soon.
I solved the issue by creating a function. I placed the function in the calculated value foruma.
setDept(userProfileLookup(ctrFullLoginID,"SPS-Department"));
yeah.
but that's being evaluated during the refresh, not after it as you originally requested
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.