Reload a form when field value changes from No to Yes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2022 12:14 AM
Hi,
We have a requirement where we need to make rest other fields disabled when in particular field(Yes/No field) value is selected as "No". Written a onChange client script for this which is working.
Here we need to Reload the form when user changes the value from "No" to "Yes". Can I know which script should be added for this.
note: when "Yes" is selected initially form should work normally.(no need to disable fields /reload form)
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2022 12:28 AM
Hi,
why to reload when value changes? what about the fields which user entered? they won't be saved automatically and user will get pop-up message.
regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2022 12:31 AM
Hi @Lina
You can try below code command in your onChange client script
location.reload()
Feel free to mark correct, if your issue has been resolved, so it ends up in solved queue.
Will be helpful for others looking for the similar query.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2022 12:40 AM
Will this script work?
if (( oldValue == No && newValue == Yes )
reloadWindow(the page with we want to reload);
location.reload();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2022 12:38 AM
No need to save the fields which user already entered.
It's the requirement, that when user will select No first and then changes to Yes, then whole form should be refreshed.