The CreatorCon Call for Content is officially open! Get started here.

how to trigger an event from a UI Action button

sonbol_montakha
Giga Contributor

I have a send button , by clicking the send button an email should be sent to some people. I've already set up an email notification , an event, and a business rule. But my question is that how do I trigger the event with my UI action button ( send)?

1 ACCEPTED SOLUTION

Only if you are using the parameters as recipients should you choose to check these.


View solution in original post

19 REPLIES 19

So... a few things.   As long as you're on a relatively recent version, there ARE decent ways to preview notifications:


find_real_file.png



Testing of notifications is not something I would do outside the context of a given solution on the platform.   That is to say, I shouldn't HAVE to test for the hundreds of templates a large company has.   I should test notifications meaningful to a specific solution as a part of deploying that solution to the platform.



The other thing, architects should avoid any situation involving hundreds of templates no matter the company size.   Templating *at all* is used to reduce the complexity and administrative load of having hundreds of stakeholders that want tailored alternatives to a common solution.


Robert,


As a member of the "Bottom Rung Club," I do what I am assigned to do the fastest and most efficient way I can. Our "company" has a standard template that was designed several years back and not all the notifications were included in the build. The notifications do not all contain the same info. Also, with new email programs becoming readily available, all the emails needed to display correctly. This was the reason for the Send Test Email button on the notification form. Yes, the Preview does work but the email as displayed in different manners, IE vs Firefox vs iPhone vs Android, was the issue I was solving.



Maybe in the future this might be solved, but at this point, I have completed all the fixes, all the code rewriting, and all the creation of many, many INC/REQ/PRB/KNOW/ etc. forms.



I guess you could say it helps with job retention?...



Thank you for all your assistance and insight. I am sure we will speak (type?) again soon.



Marshall Day


My guess is that you have your code in the UI Action. If this is the case, and all you need to do is send the event queue, you can do away with the Client portion of the UI Action and just use the code within the send function. You can un-check the Client checkbox on the UI Action, remove the onClick function and just put the code you need:


var email = 'test@test.com';


gs.eventQueue('testNotification', current, email);



If you are going to be using the event for a notification, make sure you have the event registered and associate the event with the notification you want to use.


Here's where we're at now.   My Developer came back with the following and I need help.



Title:


Setting Up UI Action buttons for Every Row on a Table's List
View.



Message:


Hello,



I'm having trouble trying to set up UI Action buttons to be
displayed on every row on a List View. My problem is very much similar to this
following issue https://community.servicenow.com/thread/223137.



As suggested from the thread's answer, I tried replicating
my column to set up similarly   to that of the "Available Actions" field
under the "Update Set Preview Problem[sys_update_preview_problem]" table. When
creating the table column for my table, I noticed that the "UI Action List"
type was missing so I recreated the type following what the "Available Actions"
column had set up.




 




Currently my column is showing but does not contain any
visible UI Action button.



Any help would be appreciated, thanks.


Hi, I want to trigger email on clicking of submit button in 'Announcement form' .So I need to trigger event from ui action .Above you mentioned record object in syntax. can you put some light on it.what exactly it mean