Alert dialog comes up "undefined". Why?
Alert dialog comes up "undefined". Why?
This url might help if you are using response of one async call in next call based on output of first
Thanks
This url might help if you are using response of one async call in next call based on output of first
Thanks
I think what is happening is that you have two different events: the one that fills your pxtLstGuid (where there are all those async calls) and the other associated to the lookup field. So when your second event is triggered, it will probably load all javascripts again and then your context is lost, hence the variables are undefined.
So I think you will have to get the attribute again. Or create a hidden field which you will populate on the first event, so that you can retrieve it with the formContext.getAttribute("attribute_name").getValue().
Thanks. result["_defaultpricelevelid_value"] is one of the arguments to the next async. I know the next function is receiving it and (as pretty much everything in javascript) it's a string. Hence my question, why is the alert coming up "undefined".
Hi,
Please check if Sdk.pxLstGuid's value has a valid value. If so, convert the value to string.
Regards,
My goal is to not have to find the pricelevelid a second time since I have it in hand during the onLoad.
Sorry! I knew that would be a question. The series of asyncs end in adding a custom view to a lookup. The someOther is that lookup field. So, I am certain it is completed before I select the value (because it is coming from my custom view.)
I even tried ExecutionContext.SharedValues and got the same result.
thank you for looking.
Hi mardukes,
When does your function someOtherOnChangeEvent() is called? All those functions you are calling are async calls. Probably, when you are calling someOtherOnChangeEvent(), the Sdk.pxLstGuid is not filled yet, because it is being filled on an async function. That's why he is undefined.
André Arnaud de Cal...
292,516
Super User 2025 Season 1
Martin Dráb
231,409
Most Valuable Professional
nmaenpaa
101,156