Each time the state field changes, number fields background colour should be changed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2024 03:55 AM
Each time the state field changes, number fields background colour should be changed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2024 04:23 AM
hi @viswav
you can try below code
function onLoad() {
//Type appropriate comment here, and begin script below
var element = g_form.getElement('number');
if (g_form.getValue('state') == 3) {
element.style.backgroundColor = "red";
}else if(g_form.getValue('state') == 1){
element.style.backgroundColor = "green";
}
}
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful."
Thanks,
BK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2024 04:28 AM
not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2024 04:24 AM
You can use field styles for the sale. that would work on List view as well as form.
Define field styles (servicenow.com)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2024 04:29 AM
Hi @viswav ,
check the below:
Mark this as Helpful / Accept the Solution if this helps.