Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

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
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************
CISITSM #ITSM #csa #ServiceNow #TechnoFuncational Disclaimer: These videos are from my training batch. These videos did not promote any ServiceNow Sales pitch or marketing. These videos are only for knowledge purposes & basic on my experience & Knowledge. Redistribution or copying of functionality

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
Topmate: https://topmate.io/dratulgrover [ 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