- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
1. The required field should be made red asterisks, can we make them red colored? Please refer attached.
2. Internal Notes section is yellow in color in ITIL view as per screenshot attached.
Can we make them same colored style in SOW view. Thanks!
Please advise!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
g_form.setSectionDisplay() is supported in Service Operations Workspace, so the API itself should work.
I can see two potential issues in your implementation.
1. Remove the URL check first.
Your script checks top.location.href for now/sow. I would not use the URL to determine whether the form is running in SOW, because current Workspace record routes do not always contain that value, and access to top/window can also be affected by Client Script isolation.
Configure the Client Script for the SOW form view instead and test:
function onLoad() {
console.log(JSON.stringify(g_form.getSectionNames()));
g_form.setSectionDisplay('assignment', false);
}
getSectionNames() will show the exact section identifier available on that form, so please confirm that assignment is actually returned.
2. Check mandatory fields inside the Assignment section.
In your New Incident screenshot, Assignment group appears to be mandatory and empty. ServiceNow will not hide a section containing an empty mandatory field, otherwise the user would have no way to populate the mandatory value.
If Assignment Group is populated automatically by assignment logic and does not need to be entered by the agent, you would need to remove the client-side mandatory requirement before hiding the section:
function onLoad() {
g_form.setMandatory('assignment_group', false);
g_form.setMandatory('assigned_to', false);
g_form.setSectionDisplay('assignment', false);
}
Only do this if the field is populated/validated elsewhere.
Also note that SOW uses two different form views:
Service Operations Workspace
→ existing Incident Details form
Service Operations Workspace New Record
→ Create New Incident formIf the Assignment section should always be hidden rather than conditionally hidden, I would not use a Client Script. Configure both of those views under Configure → Form Layout and remove the Assignment fields/section from the respective SOW views. That is the cleaner OOTB approach.
If my response helped, please mark it as correct and close the thread, this helps future readers find the solution faster!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
@sharsha ,
Have a try on below script once,
function onLoad() {
var currentView = g_form.getViewName();
if (currentView == 'sow' || currentView == 'sow_new_record') {
g_form.setSectionDisplay('assignment', false);
}
}If my response helped, mark it as helpful and accept the solution.
Thanks,
Dinesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
1. The required field should be made red asterisks, can we make them red colored? Please refer attached.
2. Internal Notes section is yellow in color in ITIL view as per screenshot attached.
Can we make them same colored style in SOW view.
Please advise! Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
@Tanushree Maiti @Dr Atul G- LNG @SohamTipnis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
screenshots please
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
PFA, Thanks