- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2016 04:22 AM
I want to add SLA color coding to incident list but it is getting apply to form also. I dont want it for form.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2016 12:10 AM
Hi Shweta,
Please follow the procedure from the below link:
Defining Field Styles - ServiceNow Wiki
As far as I remember if you set the condition value in Field style it will show only on list but if the condition value is null then it will apply on form.
Hope that helps you!
Regards,
Shamma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2016 04:34 AM
Can you provide some screenshots? OOB it only appears on List view in UI15 and UI16.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2016 11:02 PM
I dont want color to number on form
i want color code only to list. but currently it is showing for both
When i update the record color appears on form and when i reopen that form color disappears.
checkSLA() script include
function checkSLA(number) {
//Ensure field style is used only on the list view
var listview = true;
var stag;
if (gs.getSession().isInteractive()) {
var map = gs.action.getGlideURI().getMap();
if (map.get('sysparm_record_target') != null) {
listview = false;
}
}
if(listview == true) {
var gr = new GlideRecord('task_sla');
gr.addQuery('task', number);
gr.addQuery('sla.name','CONTAINS','Resolution');
gr.addQuery('stage','!=','paused');
gr.addQuery('stage','!=','cancelled')
gr.query();
if(gr.next())
{
if(gr.percentage >= 50 && gr.percentage < 75)
//if(gr.percentage > 0 && gr.percentage < 50)
return 1;
else if(gr.percentage >= 75 && gr.percentage < 100)
return 2;
else if(gr.percentage >= 100)
return 3;
else
return 0;
// var color;
// stag = gr.percentage;
}
// return stag; // it will return current stage
// gr.addQuery('stage', 'breached');
//gr.addQuery('stage', 'in_progress');
// gr.query();
// return gr.hasNext();
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2016 12:45 AM
check at some places semicolon is missing in your code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2016 12:10 AM
Hi Shweta,
Please follow the procedure from the below link:
Defining Field Styles - ServiceNow Wiki
As far as I remember if you set the condition value in Field style it will show only on list but if the condition value is null then it will apply on form.
Hope that helps you!
Regards,
Shamma