UI Action

Andrew112
Kilo Guru

Hello, I made a UI Action in order to create a notification in ServiceNow to basically generate an award and send it to the nominee of that award.

 

The code looks like this:

 

 

current.u_award_winner_notification_sention  = true;
gs.eventQueue("wingsawardfire", current, gs.getUserID(), current.u_name);
current.update();
gs.addInfoMessage("Notification Email Sent")

 

 

But unfortunately it is not working... What am I doing wrong

 

What I would like it to do is, I made a checkbox on table XXXX, (which is where this UI action resides) I would like it to check the checkbox, then create a new event which triggers the new notifications (it is set to trigger by opening that event) then email the person in parm2 (current.u_name) with the award notification email, then show that the notification was sent.  

2 ACCEPTED SOLUTIONS

No error... the event was created sorry i see it now in the event log:Screenshot 2023-09-14 at 10.06.38 AM.pngScreenshot 2023-09-14 at 10.07.24 AM.png

No notification came to my inbox though... weird.

 

I just put nominee.email to see if that will work? I dunno. I'll let you know if that makes a difference

 

 

View solution in original post

No worries.

 

Do you have send to event creator checked in the notification?
Otherwise, you will not receive it, since you are creating the event.


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

View solution in original post

7 REPLIES 7

Peter Bodelier
Giga Sage

Hey @Andrew112,

 

Can you see the event coming in the event log, and are all fields filled as expected?
Since the recipient is available in the current object, I wouldn't set the recipient by parameter, but just choose that field in the notification.


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

No I cannot see the event being created, and the checkbox isnt being filled.. thats why I am unsure what I did wrong.

Can you share a screenshot of your UI Action?


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

Sure... I just set the recipient as the nominee in the notification so it is not using parm2 as the recipient and this point.