Alert OnLoad Client Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2020 11:00 AM
Hello Folks,
Does any body know how to show alert after all the variables on the form are loaded.
Steps to Reproduce:
Go to any catalog item ..containing 1 or more variables ...create a client script and in that write a simple alert("Hello");
now when you try to load the form ...you will see the alert first then you see the variables loaded. I want it in a reverse way ...load all the variables and then alert.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2020 04:41 PM
It runs when a field value changes...So I assume you are setting some field values onLoad...So the setting values runs the onChange Client script.
Another option could be to add a wait and then alert. For ex, you can try below in an onLoad client script
setTimeout(function(){ alert("Hello"); }, 3000);
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2020 07:29 PM
The first pic does not show any variables, the second pic shows variables...My intent is I want to show the alert once loading of all the variables are done on the form, because I am doing some DOM operations where I want to do that only when all the variables are completely loaded. I can go with timeout function but that is un-predictible I mean It will always wait for certain period of time ir-respective of variables complely loaded or not ..instead ..I need some function to execute as soon as all the variables are loaded, it might take 3ms, or 30 ms or 300 ms,...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2020 08:00 PM
Have you tried UI Policies Script instead of Catalog Client Script?
UI Policy Script can be check on field content. (e.g. "field is empty").
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2020 08:12 PM
Same Behaviour,
Actuallly I want to add HyperLink to a check box, So I am going with DOM operations, I am able to achieve that using on chagne client script ....when I am trying it on Load ..the element is not avaible to to apply the DOM changes ..so I want to apply DOM chagnes when all the elements are available on the form.