What is "isLoading" in client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2020 07:41 PM
Hi all,
In client script there is a predefined flag "isLoading", I am wondering when it should be used.
I think almost client scripts are executed after the UI was rendered, I am wondering if someone could give an example of something can be done in the middle of loading?
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2020 09:42 PM
So, does this means that both onLoad & onChange script runs one after another in the time of Loading the form to user. Apart from the fact, that, onChange even runs when a field is changed.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2020 10:20 PM
Hi Yash
I would Like to add my views here.
answer to your Question is
onLoad will always work as soon as form loads.
onChange will work only if the fields changes for which you have written script.
client scripts runs on users browser:-
If you have written a onLoad Client Script it will run as soon as form gets fully loaded to you after buffering. It is not a field dependent script.
Your onChange will work only when there is change in the field which you have entered in field section.
check the below screenshot.
onLoad:-Every Time Your Form Loads, it will definitely work.
Now we will try with onChange. with state field.
If there is change in your state then and then you will see the alert on the screen. otherwise it will not show you alert.
Now we will check this with another fields.
I will change the impact and urgency.
we will not get the alert as the changes are on another field.
Now one More Topic:-
I would like to tell you that,
Your This onChange Client script can work as onLoad.
That means as soon as your form Loads it will give you alert.
Just Remove the isLoading || from the script.
check you will see alert as soon as form loads. rather than change in the Field.
I Hope, You are clear Now
Please Mark Correct and Helpful
Thanks and Regards
Gaurav Shirsat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2020 10:42 PM
Hi Gaurav,
Even i was referring to this isLoading part, isn't it that way, that, since any thing that we have to make run on and as onLoad in a onChange we make it under this if condition ( or do it the way you did) but we are unable to see the result as by default it returns null (but checks the condition on the time of load i.e when onLoad runs).
This particular if statement check and return makes me wonder if both the scripts run when a NewRecord is initiated.
PS: - if you try to add a change value statement between two alerts, both the alerts willl popup first, then the field value will be changed.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2020 10:59 PM
- isLoading: boolean value indicating whether the change is occurring as part of a form load. Value is true if change is due to a form load. When forms load, all the field values on the form change as the record is loaded into the form.
Please let me know whether I have given you required answer or not?
else describe the your case here in some different way, so that I can resolve your query.
Please Mark Correct and Helpful
Thanks and Regards
Gaurav Shirsat