- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2022 11:55 PM
Hi.
I'm learning because I'll be using onChange's Client Script for future development.
I have confirmed the official Learn and community about is Loading, but I do not understand enough to verbalize it.
Could you please tell me the following in an easy-to-understand manner?
- If it is isLoading in the conditional expression, it says that the process will end, but is it okay to recognize that if you update the field and load the form without releasing the cursor, the script will not be executed?
- What happens if I delete the if statement and return, and is it okay to delete them?
Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2022 12:07 AM
Hi Ereshkigal,
There is a way in onChange client script that we can execute the onLoad client scipt as well.
You can write onChange code in the block that says begin script below, and for on load code you can write that inside if block. This will execute onLoad and onChange codes in a one client script only. Script will execute on loading as well the after changing a specific field value which mentioned in onChange.
Its not best practice to remove isLoading but if you wanna see the result, you can try this in your PDI.
If it helps please mark helpful.
Thank you
Gaurav Rotke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2022 12:07 AM
Hi Ereshkigal,
There is a way in onChange client script that we can execute the onLoad client scipt as well.
You can write onChange code in the block that says begin script below, and for on load code you can write that inside if block. This will execute onLoad and onChange codes in a one client script only. Script will execute on loading as well the after changing a specific field value which mentioned in onChange.
Its not best practice to remove isLoading but if you wanna see the result, you can try this in your PDI.
If it helps please mark helpful.
Thank you
Gaurav Rotke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2022 12:20 AM
Hi,
the isLoading check simply tells you that the script can run on form load
There are use cases where we need to perform some scripting when form loads and then onChange should work
if you remove line 2,3,4 it's just that your client script would be purely onChange and you cannot use it for onLoad activities
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
