- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 04:37 AM
We have a requirement that in list view, user should be able to change status of bulk cases to Closed/Cancelled. I am getting Security Constraints error when I try to edit status field from list view even as admin. So is it possible to close/cancel cases from list view directly? Is there any workaround for this. Please help me with this.
Thanks
Solved! Go to Solution.
- Labels:
-
Customer Service Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 04:55 AM
Hello Shruti,
You can create new "list_edit" ACL on Case table and give the access to admin or some other role the access to edit the list view. You can also check if some existing ACL is restricting the access and deactivate the same as well.
Hope it helps!!
Please Mark ✅ Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg
Regards
Sulabh Garg

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 04:55 AM
Hello Shruti,
You can create new "list_edit" ACL on Case table and give the access to admin or some other role the access to edit the list view. You can also check if some existing ACL is restricting the access and deactivate the same as well.
Hope it helps!!
Please Mark ✅ Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg
Regards
Sulabh Garg

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 05:32 AM
Hello Shruti,
Another option depending on who you want to have the ability to bulk cancel or close tasks without modifying ACLs is a "list choice" UI Action backed with a GlideModal and an AJAX Script Includes. We had this same requirement from our business unit and built two separate list actions - Cancel Cases which requires a cancellation note and very similarly Resolve Cases which requires a resolution code and note. Both processes also check for active work orders before allowing the parent record to be resolved/cancelled; but you could leave that validation out if it is not a requirement. Here is how we solved the same requirement -
Cancel Cases - UI Action:
Form Config:
//Action name set to - resolve_cases
//Onclick set to - resolve()
//Condition set to - gs.hasRole("sn_customerservice_agent") || gs.hasRole("admin");
function resolve(){ //Calling onClick function
var tableName = g_list.getTableName();
var recordIds = g_list.getChecked();
var gdw = new GlideModal('sn_customerservice_resolvecases');
gdw.setTitle('Fill the resolution code and notes');
gdw.setPreference("table_name", tableName);
gdw.setPreference("record_ids",recordIds);
//gdw.setSize(550,300);
gdw.render();
}
Cancel Cases - UI Page Configuration:
UI Page HTML -
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<style>
#cancellationNotes {
overflow: hidden;
width:90% !important;
overflow-wrap: break-word;
resize: none;
margin-bottom: 20px;
font-size: 20px;
}
#form_buttons {
float: right;
position: relative;
right: 7.7%;
}
</style>
<link rel="stylesheet" href="styles/heisenberg/heisenberg_all.css"/>
<g:inline template="heisenberg_output.xml" type="css"/>
<g:evaluate var="jvar_table_name" >
var tableName = RP.getWindowProperties().table_name || RP.getParameterValue('table_name') || '';
tableName;
</g:evaluate>
<g:evaluate var="jvar_record_ids" >
var recordSysIds = RP.getWindowProperties().record_ids || RP.getParameterValue('record_ids') || '';
recordSysIds;
</g:evaluate>
<div id="notification_msg_container"></div>
<input type="hidden" value="${jvar_table_name}" id="tableName"/>
<input type="hidden" value="${jvar_record_ids}" id="recordIds"/>
<g:ui_multiline_input_field name="cancellationNotes" id="cancellationNotes" label="Cancellation Notes" mandatory="true"/>
<div id="form_buttons">
<g:dialog_buttons_ok_cancel ok="return continueOK()" ok_type="button" cancel_type="button"/>
</div>
</j:jelly>
UI Page Client Script -
function continueOK() {
var tableName = gel('tableName').value;
var recordIds = gel('recordIds').value;
var cancellationNotes = gel('cancellationNotes').value;
if (cancellationNotes.trim() == '') {
addMessageBox("A cancellation note is mandatory!", 'alert-danger');
return false;
}
var ga = new GlideAjax("sn_customerservice.caseActionUtils");
ga.addParam("sysparm_name", "cancelCases");
ga.addParam("sysparm_table_name", tableName);
ga.addParam("sysparm_case_ids", recordIds);
ga.addParam("sysparm_cancellation_notes", cancellationNotes);
ga.getXMLAnswer(function(answer) {
GlideDialogWindow.get().destroy();
});
}
function addMessageBox(msg, cls) {
var targetWindow = window.parent || window;
var NOTIFICATION_MSG_CONTAINER = 'notification_msg_container';
var $msgContainer = targetWindow.jQuery('#' + NOTIFICATION_MSG_CONTAINER);
if ($msgContainer.length === 0) {
$msgContainer = targetWindow.jQuery('<div id="' + NOTIFICATION_MSG_CONTAINER + '" style="position:fixed; top: 35px; z-index: 1000; left: 0px; right: 0px; margin: 15px;"></div>');
$msgContainer.appendTo(targetWindow.document.body);
}
cls = cls || 'alert-danger';
cls += ' alert alert-dismissible';
var html = '<div class="' + cls + '">';
var removeScript = "jQuery('#" + NOTIFICATION_MSG_CONTAINER + "').empty(); return flase;";
html += '<a href="#" class="icon-cross close" data-dismiss="alert" style="margin-top: 0px;" aria-label="close" onclick="' + removeScript + '"></a>';
html += msg;
html += '</div>';
$msgContainer.append(targetWindow.jQuery(html));
}
Cancel Case AJAX Script Includes -
cancelCases: function() {
var caseIDs = this.getParameter("sysparm_case_ids");
var tableName = this.getParameter("sysparm_table_name");
var cancellationNotes = this.getParameter("sysparm_cancellation_notes");
//Check for active work orders on cases attempting to be cancelled...
var woCheck = new GlideRecord("wm_order");
woCheck.addEncodedQuery('initiated_from.sys_idIN' + caseIDs + '^active=true');
woCheck.query();
if (woCheck.next()) {
//Initial error message required to allow for all returned WOs to be noted in error message...
gs.addErrorMessage(gs.getMessage('Cannot cancel ' + woCheck.initiated_from.number + ' due to open work order ' + woCheck.number + '. Please close or cancel the work order and then attempt to mass close this selection of cases again!'));
while (woCheck.next()) {
gs.addErrorMessage(gs.getMessage('Cannot cancel ' + woCheck.initiated_from.number + ' due to open work order ' + woCheck.number + '. Please close or cancel the work order and then attempt to mass close this selection of cases again!'));
}
gs.addErrorMessage(gs.getMessage('Mass case cancellation unsuccesssful.'));
return false;
} else {
var caseGr = new GlideRecord(tableName);
caseGr.addEncodedQuery('sys_idIN' + caseIDs);
caseGr.setValue('state', 7);
caseGr.setValue('close_notes', cancellationNotes);
caseGr.setValue('resolution_code', 14); //Set Resolution Code to Cancelled (14)
caseGr.updateMultiple();
gs.addInfoMessage(gs.getMessage("Successfully cancelled " + caseIDs.split(",").length + " cases. Please refresh your page."));
return true;
}
},
If this has been helpful and allowed you to achieve what you were looking for, I would love it if you would mark it as correct/helpful! If you have additional questions, let me know.
Thank you,
Michael

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 08:08 AM
Pretty cool solution Michael! Thanks a bunch for sharing. Unfortunately I cannot tell if it was helpful to the OP! 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 08:40 AM
Thanks Mahesh!
I'm happy to hear you found it helpful. Our agents love the functionality and it still allows us to keep to our internal processes by providing the appropriate cancellation notes.
Always happy to share,
Michael