How to send a notification using UI action?

prash4
Tera Expert

I have requriement, where i need to create a ui action and when clickon ui, we need to send an email.

1) created event on incident table

2) created notification on incident table.

when to send > event is fired.

3) Created ui action on incident table

added event in ui action but i am not able to send notification.

Quick help would be really appreciated.

8 REPLIES 8

Sagar Pagar
Tera Patron

Hi @prash4,

 

gs.eventQueue() method will not work in Client side code. I mean to say in onclick function. It will only work in server side code.

 

Take a look at this example - How to use client and server side code in UI actions without errors 

 

If my response helps you resolve your issue. Kindly mark it as helpful & correct. It will be helpful to future readers! 👍🏻
Thanks,
Sagar Pagar

The world works with ServiceNow

Hi @prash4,

 

Have you looked into my comments? if required any help let me know.

 

If my response helps you resolve your issue. Kindly mark it as helpful & correct. It will be helpful to future readers! 👍🏻
Thanks,
Sagar Pagar

The world works with ServiceNow

Hi @Sagar Pagar .

I tried looking into you comments and worked on it. i have some questions. how to make disappear or hide ui action once clicked on the ui action.

 

Thank you

Hi @prash4,

 

If you click the UI action, are you updating any fields like state or flags? If yes, simply add the same condition so that UI action will be hidden or visible.

 

If my response helps you resolve your issue. Kindly mark it as helpful & correct. It will be helpful to future readers! 👍🏻
Thanks,
Sagar Pagar

The world works with ServiceNow