how to generate notifications by using ui action

Shantharao
Kilo Sage

hi folks,

how to trigger notifications/emails from ui action.

regards

burra

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi Burra,



To add to Ram's message, an example might look something like this:



find_real_file.png



The form context menu only appears if the condition is true. When the menu option is chosen, an event gets triggered. If there is a registered event, and a notification responds to that event, then your notification is triggered.



More reference:


Event Registry - ServiceNow Wiki


UI Actions - ServiceNow Wiki  


View solution in original post

3 REPLIES 3

ramireddy
Mega Guru

You can use Events & Notifications to send emails via UI actions. Please check below link about events email notifications



Events and Email Notification - ServiceNow Wiki



Once you set up them, from your UI action script, you can invoke the events like below.



gs.eventQueue('Event name',null,param1,param2);

Chuck Tomasi
Tera Patron

Hi Burra,



To add to Ram's message, an example might look something like this:



find_real_file.png



The form context menu only appears if the condition is true. When the menu option is chosen, an event gets triggered. If there is a registered event, and a notification responds to that event, then your notification is triggered.



More reference:


Event Registry - ServiceNow Wiki


UI Actions - ServiceNow Wiki  


nitin_kumar
Mega Guru

Hi,


You can achieve this in three steps


1. Create an Event.


2. Create a Notification as per your requirement and use the created event as the trigger.


3. Create an UI action which fires your event with a single line of code ie.,


gs.eventQueue('event_name', null, parm1, parm2);


Email Notifications - ServiceNow Wiki


Events and Email Notification - ServiceNow Wiki


Thanks,


Nitin.


PS - Please mark Helpful, Like, or Correct Answer if applicable.