- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2024 12:27 PM - edited 12-07-2024 09:25 PM
Change the number field background color of the incident if the priority is Critical.
Write onChange Client Script.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2024 03:49 PM
Create a client script.
- Open an incident
- Right click on the header section and select "Configure" > "Client Scripts"
- Click on the "New" button at the top right corner
- Enter script
function onChange(control, oldValue, newValue, isLoading, isTemplate) { var number = g_form.getControl('number'); if (newValue == 1) { number.style.backgroundColor = 'red'; } else { number.style.backgroundColor = ''; } }
Result:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2024 12:35 PM - edited 11-04-2024 12:35 PM
Hi @pragatishendre ,
I am not sure, if you are sharing the logic or asking.
This can be done via Style [sys_ui_style ] also, you can check some existing style and replicate for priority field
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2024 03:49 PM
Create a client script.
- Open an incident
- Right click on the header section and select "Configure" > "Client Scripts"
- Click on the "New" button at the top right corner
- Enter script
function onChange(control, oldValue, newValue, isLoading, isTemplate) { var number = g_form.getControl('number'); if (newValue == 1) { number.style.backgroundColor = 'red'; } else { number.style.backgroundColor = ''; } }
Result: