Delete all closed incident when user click on module

Mark Wood
Tera Contributor

Hello Experts,

I have created a module in my application that allows users to delete all closed incidents. When a user opens this module, a pop-up should appear, asking the user if they really want to delete all closed incidents. When the user clicks "yes," all incidents should be removed from the incident table.

8 REPLIES 8

Yes @Ankur Bawiskar ,

 The events are in a closed state. When a user clicks on the 'delete event' module, a confirmation pop-up should appear with two choices: 'Yes' and 'No.' If the user clicks 'Yes,' all closed events should be deleted; otherwise, they should not be deleted.

@Mark Wood 

why not give that user(I would recommend only admin) access to that table and let them delete the closed records by applying filter on that table?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hello @Ankur Bawiskar , we are implementing functionality to clean up events that are closed. If there are 50,000 events, it's very difficult to delete them manually, which is why we are implementing this.

@Mark Wood 

then you can do this

1) the left nav module can be URL type arguments.

2) call UI page and there add confirmation message and yes and no buttons

3) once user clicks Yes you can proceed with the deletion

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader