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

manasi7
Kilo Contributor

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.

4 REPLIES 4

Michael Fry1
Kilo Patron

Try replacing action with isActionDelete(actionName)

manasi7
Kilo Contributor

Hi 
 this method is not working. 

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.

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!