- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2022 11:24 PM - edited ‎05-14-2025 07:54 AM
Dear Experts.
Please tell me.
For catalog task items, I would like to change the background and text color of certain field items once the checkbox is turned on.
Please refer to the attached image together.
By the way, the attached image is read-only, but the item I want to implement above is actually an input-enabled field.
Best regards.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2022 11:42 PM - edited ‎10-20-2022 01:01 AM
Hello,
If it is for SCTASK fields You can do this by going to Configure Style of field and under 'Value' you can specify condition.
If it is for for SCTASK variables then use below solution.
Please note : Fields and Variables are different, if you are referring to something from catalog item then refer them as variable and if you are referring to backend form like RITM or SCTASK form then refer them as fields.
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2022 12:49 AM - edited ‎10-20-2022 12:50 AM
Hi @M_Tomy
As you want to run this for the RITM variables you need to use below logic:
Write UI Policy on RITM and CTask level so that it will run only on RITM records and Catalog task records.
Give appropriate conditions and write the code in Run script section:
function onCondition() {
var form = typeof g_sc_form != "undefined" ? g_sc_form : g_form;
var myControl = form.getControl("alphanumeric");
myControl.style.backgroundColor = 'Red';
myControl.style.color = 'Blue';
}
Refer below KB article for more info:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0547171
Hope it helps
Let me know if any doubts
Murthy

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2022 11:42 PM - edited ‎10-20-2022 01:01 AM
Hello,
If it is for SCTASK fields You can do this by going to Configure Style of field and under 'Value' you can specify condition.
If it is for for SCTASK variables then use below solution.
Please note : Fields and Variables are different, if you are referring to something from catalog item then refer them as variable and if you are referring to backend form like RITM or SCTASK form then refer them as fields.
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2022 12:27 AM
Mr. Musab Rasheed
I have understood your response.
I will try to implement it as soon as possible.
Thank you for your urgent reply.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2022 12:49 AM - edited ‎10-20-2022 12:50 AM
Hi @M_Tomy
As you want to run this for the RITM variables you need to use below logic:
Write UI Policy on RITM and CTask level so that it will run only on RITM records and Catalog task records.
Give appropriate conditions and write the code in Run script section:
function onCondition() {
var form = typeof g_sc_form != "undefined" ? g_sc_form : g_form;
var myControl = form.getControl("alphanumeric");
myControl.style.backgroundColor = 'Red';
myControl.style.color = 'Blue';
}
Refer below KB article for more info:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0547171
Hope it helps
Let me know if any doubts
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2022 02:11 AM
Mr. Murthy Ch
Thank you for your response.
This method was more the way I wanted it to be.
It was easy to understand in terms of my implementation skills.
Thank you very much.