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.

Reference field color change based a certain CI selected

Paul120
Tera Contributor

Hello!

 

I have onChange client script for all CIs in the Affected CI field when selected will change the field background color.

 

var c = g_form.getDisplayBox('cmdb_ci');
c.style.backgroundColor = 'yellow';

 

How to do one for only certain CIs that has a checkbox marked or has the value of true to change color for this condition?

5 REPLIES 5

Dr Atul G- LNG
Tera Patron

HI @Paul120 

 

Did you check the styles available OOTB.

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

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

Yes, I've checked styles.  But, the background color shows for all the CIs.  Affected CI field style.JPGHow to set the background color only for certain CIs that contains a checkmarked?

Hi @Paul120 

 

OOTB style on VIP caller

 

LearnNGrowAtul_0-1705084985757.png

 

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

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

Yes, the background color is showing on the list view and on the preview of the record.  But, how to set the background color of the Affected CI field when a certain CI is selected from this field in an Incident?

 

CI test.JPG