Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Onload client script to make fields visible & Mandatory

Not applicable

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

Hi @Community Alums 

 

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

Easy and quick.

 

https://youtu.be/fL50dcZIIkA

 

****************************************************************************************
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
******************************************************************************************
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.

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!

Not applicable

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 @Community Alums 

 

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. 

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

This is for variables & not fields.

How many variables are there?

This is making the whole variable editor read only.

-Anurag