Onload client script to make fields visible & Mandatory

Ankita Gupte
Kilo Sage

Hello Experts,

 

Please help with onload client script. i.e if the RITM Stage is "In-stock" then make fields a,b,c,d visible & mandatory else they should not be visible/mandatory/readonly

10 REPLIES 10

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Ankita Gupte 

 

NO need to write code , better to use OOTB way - catalog UI policy.

Easy and quick.

 

https://youtu.be/fL50dcZIIkA

 

*************************************************************************************************************
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]

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

Ayushi12
Mega Sage

Hi Ankita,
You can achieve this by UI Policy.
Refer: https://docs.servicenow.com/bundle/washingtondc-platform-administration/page/administer/form-adminis...

If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful."

Thanks!

Ankita Gupte
Kilo Sage

Hi All,

 

Appreciate the responses.

 

I cannot go with UI Policy because we have a onload client script on RITM table which makes all RITM fields read only. so I need to modify this client script only to exclude editable fields only for that particular RITM Stage.

AnkitaGupte_0-1720436837822.png

 

Hi @Ankita Gupte 

 

It better to make changes and come on OOTB way, instead of CS , use UI policy. Just think, for 1 case you facing issue now, and tomorrow this CS can cause many issue. 

*************************************************************************************************************
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]

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

This is for variables & not fields.

How many variables are there?

This is making the whole variable editor read only.

-Anurag