DeleteMultiple Not working in glidemodel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 01:21 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 02:51 AM
Hi @Mark Wood,
You can't.
After closing the GlideModal, call a server side script (script include) with a GlideAjax call. In that script you can execute the rest of your logic.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 01:26 AM
Hi @Mark Wood,
Deletemultiple is not available client side, only server side.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 03:47 AM
Hi @Mark Wood ,
Peter is correct, you are not able to run GlideModal in server side.
You will need to pop up GlideModal in UI Action then call client callable Script Include to delete records and return value from the delete function.
In UI Action, capture the returned value from Script Include function then refresh the page accordingly.
Created a table to simply show how does this work, please see below:
1. The table includes two fields: Name (String) and Age (Integer)
2. In UI Action:
Script in UI Action:
function deleteRecords() {
var gm = new GlideModal("glide_confirm_basic", true, 600);
gm.setTitle("Confirmation");
gm.setPreference("title", "Are you sure you want to delete some records?");
gm.setPreference("onPromptComplete", function () {
var ga = new GlideAjax('x_45354_playground.DeleteRecords');
ga.addParam('sysparm_name', 'delete');
ga.getXMLAnswer(deleted);
function deleted(answer) {
if(answer=="ok"){
g_list.refresh(1);
}
else{
alert("Some went wrong!");
}
}
});
gm.setPreference("onPromptCancel", function () {
alert("Cancelled");
});
gm.render();
}
3. In Script Include
Script in Script Include
var DeleteRecords = Class.create();
DeleteRecords.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
delete:function(){
try{
var gr = new GlideRecord("x_45354_playground_test");
gr.addEncodedQuery("age>15");
gr.query();
gr.deleteMultiple();
return "ok";
}
catch{
return "error";
}
},
type: 'DeleteRecords'
});