Restrict adding/deleting of checklist item?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2017 09:40 AM
Hello community,
Does anyone know if it's possible to not allow users to add additional checklist item or remove an existing checklist item?
I have a Business Rule to load a checklist from template after a record is created, and expect the users to work with the items from the template. I would like to turn off the ability for users to add additional check list items or remove an existing item. Is this possible?
Thanks,
Jenny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2017 01:28 PM
Hi Jenny,
I am not aware of functionality to lock down this functionality; however, you could create an onLoad Client Script for these records that removes the functionality from the form. Something like the below might work.
var domMenu = document.getElementsByClassName('icon-contain-menu'); // Checklist menu
var domAdd = document.getElementsByClassName('add-item'); // Add Item Row
var domHandle = document.getElementsByClassName('handle-contain'); // Reorder Icon
var domIcon = document.getElementsByClassName('icon-contain'); // Delete Icon
removeDom(domMenu);
removeDom(domAdd);
removeDom(domHandle);
removeDom(domIcon);
function removeDom(elemArray) {
while(elemArray.length > 0) {
elemArray[0].parentNode.removeChild(elemArray[0]);
}
}
Hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2017 10:43 AM
Hi Michael,
Thanks for your reply. I tried the onLoad Client Script code you have provided, and the document object returns null. Is there a way to refer to a checklist formatter on a form using g_form?
Thanks,
Jenny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2017 01:59 PM
Hi Jenny,
Unfortunately I am not aware of any methods to access the checklist through the g_form.
Regards,
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2017 02:25 PM
Hi Jenny,
I worked on an onLoad script that should wait for the checklist to render before removing the functionality. Let me know if this works for you.
function onLoad() {
var domChecklistItems = document.getElementsByClassName('handle-contain');
setTimeout(function waitChecklistItems() {
if (document.body.contains(domChecklistItems[0])) {
var domMenu = document.getElementsByClassName('icon-contain-menu'); // Checklist menu
var domAdd = document.getElementsByClassName('add-item'); // Add Item Row
var domHandle = document.getElementsByClassName('handle-contain'); // Reorder Icon
var domIcon = document.getElementsByClassName('icon-contain'); // Delete Icon
removeDom(domMenu);
removeDom(domAdd);
removeDom(domHandle);
removeDom(domIcon);
} else {
setTimeout(waitChecklistItems, 10);
}
}, 10);
function removeDom(elemArray) {
while(elemArray.length > 0) {
elemArray[0].parentNode.removeChild(elemArray[0]);
}
}
}