List UI Action Confirm for Multiple Records

David Sloan
Giga Guru

I have a UI action that can change a value for multiple records at once. If someone selects multiple records in a list and clicks that UI action, I would like a confirm window to pop up. It does not look like a can put this in the script, because the script is per record, and I want the confirm popup to appear once no matter how many records are selected. How can I accomplish this?

2 REPLIES 2

sachin_namjoshi
Kilo Patron
Kilo Patron

You can put this in UI action script like below

check the 'client' checkbox in your UI action and in 'onclick' field call function like cancelTicket()


function cancelTicket(){


      var answer=confirm("Are you sure you want to cancel this record?");


      if (answer==true)


              {


              gsftSubmit(null, g_form.getFormElement(), 'cancel_change'); //MUST call the 'Action name' set in this UI Action


      }


      else


              {


              return false;


      }


}



if(typeof window == 'undefined')


      {


      current.state = 8;


      current.update();


      action.setRedirectURL(current);


      gs.addInfoMessage('The current change request has been cancelled.');


}

 

Regards,

Sachin

Alejandro RP
Kilo Guru

Hi,

You can use:

var checkedList = g_list.getChecked();

To have the number of rows checked when you click the UI Action list choice.

Thanks,