Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2020 08:13 AM
Hi all,
Is it possible to have multiple onClick functions in a UI action?
E.g:
resolveIncident(); copyAttachments()
Solved! Go to Solution.
1 ACCEPTED SOLUTION

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2020 04:58 AM
Hi,
You don't need to add the function into the UI Client Script, you just need to call it.
function myFunctionSubmit(){
var x = $$('.attachment_checkbox[value=true]'); //array of the checkbox elements
if(x.length == 0)
{
alert("Please select an attachment");
return false;
}
else if (x.length > 0)
{
var list_of_attchs_ids = '';
var attch_name = '';
for (var j=0; j< x.length; j++) {
//get the sys_id of the attachment from the checkbox element name
attch_name = x[j].name.split(':');
if (list_of_attchs_ids=='')
list_of_attchs_ids = attch_name[1];
else
list_of_attchs_ids = list_of_attchs_ids + ','+ attch_name[1];
}
var ajax = new GlideAjax("getAttachmentLists");
ajax.addParam("sysparm_name","updateAttachmentList");
ajax.addParam("sysparm_attachmentsysid",list_of_attchs_ids);
ajax.getXMLWait();
}
var ticket_id = g_form.getUniqueValue();
var table_name = g_form.getTableName();
var newURL = 'email_client.do?sysparm_table=' + table_name + '&sysparm_sys_id='+ ticket_id +'&sysparm_target=' + table_name + '&sys_target=' + table_name + '&sys_uniqueValue=' + ticket_id +
'&sys_row=0&sysparm_encoded_record='; //build the URL of the email client window
//alert(newURL);
popupOpenEmailClient(newURL); //opens the email client
resolveIncident();
GlideDialogWindow.get().destroy(); //to automatically close the window
}
function myFunctionCancel()
{
GlideDialogWindow.get().destroy();
}
11 REPLIES 11
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2020 06:57 AM
Very simple indeed! Thank you very much.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2020 07:17 AM
You're most welcome ! 😄