- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 06:07 AM
Hi
I am trying to create a UI action that does 2 things
- Pop up a Client email
- Update a field on the ticket with date & Time
I seem to be able to do both seperatly but not togeother,. hers is my code
To update the incident:
gs.eventQueue('leaver.email', current);
current.u_email_sent_to_sme = gs.nowDateTime();
action.setRedirectURL(current);
current.update();
To call the Email Client Template:
function showEmail1(){
emailClientOpenPop('request', false, null, null, '1537a78e1b4fb550cbb7dce7b04bcb06');
}
Obviously to call the template I need to select Client on the UI Action & add the function to 'Onclick' however when I do this the part that updates the ticket does not work. If I add the ticket update to the function or a separate function this does not work. Both coded separately work OK.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 06:26 AM
You need to use gsftSubmit() to make both calls.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1005843
https://www.youtube.com/watch?v=yyVnpbidwmE
Thanks
Anil Lande

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 04:37 AM
Hi,
Please update your script like below:
function showEmail1() {
emailClientOpenPop('request', false, null, null, '1537a78e1b4fb550cbb7dce7b04bcb06');
gsftSubmit(null, g_form.getFormElement(), "update_request");
}
if (typeof window == 'undefined')
serverCall();
function serverCall() {
gs.eventQueue('leaver.email', current);
current.u_email_sent_to_sme = gs.nowDateTime();
current.update();
action.setRedirectURL(current);
}
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 01:35 AM
Ankur
Please see my response to Anil, I had it fixed in Dev but does not work in Prod
Jason