- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 05:16 AM
Hi team,
on RITM we have catalog variables coming from catalog item in those variables one variable name is VIP customer (check box) if that value is true i have to make RITM requested_for to red color can anyone help me in the on load client script or any other possible way
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 05:49 AM
Hi @Shabbir1 ,
See if this helps...
function onLoad() {
var displayControl = g_form.getControl('sys_display.sc_req_item.requested_for');
if(g_form.getValue('name_of_your_vip_varaible' == true){
displayControl.style.background = 'red';
}
if it doesnt work then...
Use this article to get your issue fixed :
https://servicenowguru.com/ui-scripts-system-ui/modifying-label-form-fields-client-scripts/
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 05:25 AM
@Shabbir1 Please refer to this thread https://www.servicenow.com/community/developer-forum/highlight-vip-user-in-catalog-task/m-p/2698690 to take inspiration for your onLoad script to highlight the VIP user in requested for.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 05:38 AM
How is this check box ticked? Is it something the requester does, or do you have automation filling it from the table? If it's the latter, you can easily use the link shared by Sandeep (because it is referencing to a field related to the caller/account/user/company). If it's really just a variable, filled by the requester, it will be hard to update the color, but you should also consider if having this functionality available is a good idea (every customer finds himself a vip). So I hope it's coming from the user/company table.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 05:49 AM
Hi @Shabbir1 ,
See if this helps...
function onLoad() {
var displayControl = g_form.getControl('sys_display.sc_req_item.requested_for');
if(g_form.getValue('name_of_your_vip_varaible' == true){
displayControl.style.background = 'red';
}
if it doesnt work then...
Use this article to get your issue fixed :
https://servicenowguru.com/ui-scripts-system-ui/modifying-label-form-fields-client-scripts/
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 10:12 PM
Thank you so much @Sohail Khilji for your quick response its working 👍👍