Notifications
Announcements
No record found.
Alert dialog comes up "undefined". Why?
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.
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.
My goal is to not have to find the pricelevelid a second time since I have it in hand during the onLoad.
Hi,
Please check if Sdk.pxLstGuid's value has a valid value. If so, convert the value to string.
Regards,
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".
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().
This url might help if you are using response of one async call in next call based on output of first
debajmecrm.com/.../
Thanks
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 83 Super User 2025 Season 2
Gerardo RenterÃa Ga... 49 Most Valuable Professional
#ManoVerse 40