How can I get action name in client script. when I pressed Delete button on custom application form?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2018 06:22 AM
Hi,
I wrote client script onSubmit and I try to get action name when I pressed Delete button on custom application form, It doesnot show me alert. How can I get action name on Delete .
function onSubmit() {
var action = g_form.getActionName();
alert("you pressed: " +action);}
Thanks,
Manasi Amale.
- Labels:
-
Scoped App Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2018 06:31 AM
Try replacing action with isActionDelete(actionName)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2018 02:49 AM
Hi
this method is not working.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2018 04:46 AM
Try something like this:
function onSubmit() {
var action = g_form.getActionName();
alert("you pressed: " + isActionDelete(actionName));}
//Check if any the action is some form of delete.
function isActionDelete(action){
if(action == 'sysverb_delete_custom' || action == 'sysverb_delete')
return true;
return false;
}
The action name comes from the UI action, action name field.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2018 03:21 AM
Hi Michael,
When I simply write alert("hiii"); in onSubmit method clientscript, when I pressed Delete button to delete record it doesn't show alert, but in other case like submit record or update record it shows.
I want this because on delete operation I want to update field so based on that field I will run workflow. I can't choose business rule for this because I don't want to run workflow when its deleted through REST DELETE API.
Thanks!