- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2017 10:18 AM
I have a checklist on a task that I only want to display if it's assigned to a certain group. Because formatters aren't typical items, you can't just use g_form.setDisplay...so I tried:
document.getElementById('inlineChecklistApp').style.display = "none";
...but that has no effect. Anyone know how to dynamically show/hide the checklist?
As part 2 of that question, is there a way to disable the Save / Create Template options on the formatter for end users that i don't want to add/create things?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2017 10:08 AM
Hi Adam,
For checking, if the current logged in user is member of assignment group, you can use Display Business Rule :
(function executeRule(current, previous /*null when async*/) {
g_scratchpad.checklistVisibility = false;
if(gs.getUser().isMemberOf(current.getDisplayValue('assignment_group')))
g_scratchpad.checklistVisibility = true;
})(current, previous);
and in onLoad client script, you can use below script to hide checklist :
if(!g_scratchpad.checklistVisibility)
//jQuery('#inlineChecklistApp').hide();
document.getElementById('inlineChecklistApp').style.display = "none";

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2017 10:31 AM
Hi Adam,
You can hide,show form section by using below code
https://www.servicenowguru.com/scripting/client-scripts-scripting/showhide-form-section/
But,i am not sure about checklist formatter.
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2017 10:38 AM
wrapping it in a section then hiding that section technically works, but the UI looks bad...any other thoughts?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2017 11:03 AM
This works on my personal instance (Helsinki) - jQuery('.checklist_section.ng-scope').hide();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2017 10:08 AM
Hi Adam,
For checking, if the current logged in user is member of assignment group, you can use Display Business Rule :
(function executeRule(current, previous /*null when async*/) {
g_scratchpad.checklistVisibility = false;
if(gs.getUser().isMemberOf(current.getDisplayValue('assignment_group')))
g_scratchpad.checklistVisibility = true;
})(current, previous);
and in onLoad client script, you can use below script to hide checklist :
if(!g_scratchpad.checklistVisibility)
//jQuery('#inlineChecklistApp').hide();
document.getElementById('inlineChecklistApp').style.display = "none";