- 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
‎12-20-2017 12:18 AM
I could not get the client script for this to work in Istanbul. When running the document.getElementById('inlineChecklistApp').style.display = "none"; command I would get the error that document.getElementById is null. I am assuming that this is because the element is now added asynchronous to the form after the initial load of the page.
Thus I created the following code instead, that will continue to retry to remove the element every 0.5 seconds.
function onLoad() {
if(!g_scratchpad.checklistVisibility) {
addAfterPageLoadedEvent(function() {
(function removeChecklist() {
try {
this.document.getElementById('inlineChecklistApp').style.display = "none";
}
catch(err) {
console.log('Element not found - retrying in 0.5 seconds');
setTimeout( removeChecklist, 500 );
}
})();
});
}
}
In short the "addAfterPageLoadedEvent" fires the defined function when the page has loaded. The function will then call itself until it is able to set the display value to "none" on the style attribute of the element.
I hope this helps 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2019 09:23 PM
Consider using Checklist Pro.
The problem with the OOB checklists is that they are unreliable, meaning, people can change the content of the checklist item after the fact, add items, delete items, change items. There's also no guarantee that the same checklist will appear for same situation. There is no way to restrict who can edit the checklist or when it can be edited (like do you really want people changing checklist responses after the record has been closed).
Enter Checklist Pro. We built Checklist Pro to solve all those problems and more. Checklist Pro application administrators can define when checklists get created and associated with records in a table (any table - not just those that extend TASK), when these checklists can be edited, when the associated record is considered "closed" (and thus should prohibit further checklist updates). We even added the ability to define "Required" checklist items that allow enforcement, thereby preventing a record from closing unless the required items are completed. We've built convenience Database Views to go with the most common checklist tables, which include TASK, SYSAPPROVAL_APPROVER, CMDB_CI.
They work in the Service Portal as well as in the Classic UI.
They'll work with other Scoped Applications (like HR or SecOps or even custom scoped apps & tables).
For more information contact TyGR LLC or goto our youtube channel to see it in action.
Also - besides the classic Checkbox Item, Checklist Pro allows you to include various data types, including Textbox fields, Date, Integer, Custom Choice Lists and Reference fields.