Reload/ refresh catalog form when value changes from Yes to No

Ankita9793
Tera Contributor

Hi All,

 

I want to reload/ refresh catalog item form on sp when a field value changes from yes to no.


TIA!!

4 REPLIES 4

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Ankita9793 

 

What is your business case here? If you refresh the browser, all unsaved changes will be lost, and the user will need to fill them out again

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Ankur Bawiskar
Tera Patron
Tera Patron

@Ankita9793 

what's your business requirement here?

I agree with what Atul has shared. what if user has filled the info?

You can do this

1) Whenever user changes value from Yes to No, show user a message to use "Save Draft" feature

2) then you can reload after user confirms

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Nilesh Pol
Tera Guru

@Ankita9793 

Use g_form.refresh(); in your client script.

sanketpatil09
Tera Guru

Create an onChange Client Script in the catalog item. If the field changes from Yes to No, use window.location.reload(); to refresh the form. To clear specific fields instead, use g_form.clearValue('your_field_name');. Save the script and test it in Service Portal.