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 01:25 AM
function demo() {
var gm = new GlideModal("glide_confirm_basic", true, 600);
gm.setTitle("Confirmation");
gm.setPreference("title", "Are you sure you want to delete all closed incidents?");
gm.setPreference("onPromptComplete", function () {
var gr = new GlideRecord('incident');
gr.addQuery('state', '7');
gr.query();
var deletedCount = 0;
while (gr.next()) {
gr.deleteRecord();
deletedCount++;
}
if (deletedCount > 0) {
alert(deletedCount + " incidents deleted successfully.");
} else {
alert("No closed incidents found or could not be deleted.");
}
});
gm.setPreference("onPromptCancel", function () {
alert("You clicked on 'Cancel'");
});
gm.render();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 01:37 AM
Hello @Harish Bainsla ,
Thank you for your assistance.
it's working as expected. However, after deleting a record, I want to reload the list. I've used location. reload(), which indeed reloads the list, but the deleted record still appears. Strangely, when I manually refresh the page, the deleted record no longer shows up. Could you please explain why this is happening and guide me on how to resolve this issue?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 01:43 AM
I think as @Peter Bodelier mention its server side so you can use server side script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 01:48 AM
@Harish Bainsla how can i use glidemodel in server side script.