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

Strange, looks just fine to me.

Can you try this, to find out what's going wrong:

try{
current.u_award_winner_notification_sention  = true;
gs.eventQueue("wingsawardfire", current, gs.getUserID(), current.u_name);
current.update();
gs.addInfoMessage("Notification Email Sent")
}
catch(ex){
gs.addErrorMessage(ex)
}

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

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

 

 

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.