Simple Pop up on click of UI Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2023 08:59 PM - edited 06-14-2023 09:00 PM
I created a delete button that deletes related records. The script is working fine.
I would like to display a simple pop up that asks confirmation for deleting records .
This UI Action client marked as false
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2023 09:12 PM
HI @Kumar38 ,
I trust you are doing fine.
- Navigate to the UI Action record in ServiceNow.
- Set the 'Client' field to false.
- In the 'Script' field, add the following code:
function deleteRecords() {
if (confirm("Are you sure you want to delete the records?")) {
// Perform the deletion logic here
// ...
// ...
}
}
deleteRecords();
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2023 09:15 PM
If it's not client side then you cannot show alert
Make it both client + server and use confirm box or alert box and then use gsftSubmit to pass to server side for deletion
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 12:29 AM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader