Displaying an alert box while deleting a record from related list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2015 01:00 AM
Hi,
I am looking for a way to display an alert box while deleting a record from the related list.
Like, "You are about to delete this record" with Ok and Cancel buttons. Clicking ok should delete the record and clicking cancel should abort the delete operation.
I could do it while deleting the record directly from the form, but not while deleting from the list.
Sorry if the solution is simple and obvious. Could you please help.
Regards,
Bala
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2015 04:02 AM
so problem solved?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2015 04:05 AM
Yes, it's resolved. I wrote a new function "proceedWithDeleteFromContextMenu" in the "DeleteRecordAjax" script include and used that from the UI Action
UI Action:
--------------
if(g_list.getTableName() == 'the_table_where_we_want_this_functionality') {
var answer = confirm("Delete the selected item?");
if(answer) {
deleteThisRecord();
}
}
else {
deleteThisRecord();
}
function deleteThisRecord() {
var tableName = g_list.getTableName();
var ids = g_sysId;
var ga = new GlideAjax('DeleteRecordAjax');
ga.addParam('sysparm_name', 'proceedWithDeleteFromContextMenu');
ga.addParam('sysparm_sys_id', ids);
ga.addParam('sysparm_table_name', tableName);
ga.getXMLWait();
ga.getAnswer();
window.location.reload();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2015 07:48 AM
Hi Balakumar,
Can you please send me the code that you have written in "DeleteRecordAjax" script include. I am trying to implement the same with the List choice.
Thanks,
Vamsee.