- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2019 09:38 AM
Hi All,
I am working on one UI action to display a pop-up message in the list view and is not working. I am getting a pop-up message, but when we select a record and try to delete, the record is not getting deleted. Anyone can you please help me with this? Is this requirement feasible? because in list view current.deleteRecord() won't work as it is referring to current object and it works only in the form or single record and it won't apply for a multiple record. Can anyone please suggest any approach or ideas.
Regards,
Chaithra
This is the script I have written and is working in form view but not in list view:
function showAlert(){
if(confirm("Are you sure you want delete this record?"))
{
gsftSubmit(null,g_form.getFormElement(),'Test');
}
else
{
return false;
}
}
if(typeof window == 'undefined'){
myServerSideFunction();
}
//server-side function to delete the current record
function myServerSideFunction(){
current.deleteRecord();
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2019 11:34 AM
Yeah. Since they work differently and getting the sys_ids (one or more in a list) while on the form its a single sys_id.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2019 10:41 AM
Do you get any console errors in your browser? Or rather, there might be a separate global one for delete on the form instead of a list, because how the sys_ids are gathered are different for each. Sorry about that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2019 11:19 AM
I didn't get any console errors in the browser. So, in this case I would need to configure two UI actions in that domain in both Form and List view?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2019 11:34 AM
Yeah. Since they work differently and getting the sys_ids (one or more in a list) while on the form its a single sys_id.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2019 07:30 PM
Hi Chaithra,
you would require 2 UI actions one for form and other for list since both have their own functionality one works on form and other works on list
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2019 10:12 AM
Can we call two onClick() functions in a single UI action?