eventQueue method of gs object

Jonnie_
Tera Contributor

Has anyone came across a scenario where we need to trigger an event for notification, but we don't have and we need not to pass GlideRecord object in 2nd parameter of gs.eventQueue('event name', 'gliderecord', parm1, parm2);

 

We need to write an event but don't have any gliderecord object. Do we need to pass any random GR object?

3 REPLIES 3

Jonnie_
Tera Contributor

Without passing GR object, it won't trigger notification i believe. What we can do in such cases, any ideas?

 

@Ankur Bawiskar ,  @Jace Benson@Sagar Pagar 

Consider what's the trigger for the notification?  Is it a an escalation?  is it a ticket?  Is it something for the user themselves?  

 

What will be in notification?

 

These are the questions I consider when picking what table to the notification against and what record to use.  If for instance, you want to trigger an ad-hoc email to someone cause they were on their user profile, maybe, the record that makes the most sense it the user record so you donthave to script to get the users's details.

 

I hope this helps.

 

Without context it's hard to know if this is the right way.

The purpose here is we want to trigger a notification when a scheduled job gets executed. Scheduled job executes once a month.

So, When scheduled job runs , we a notification for particular user. But we don't have any such requirement where we need any GR field value to add on the email body.

 

So, we are just using an event to trigger a aknowledge email for user in scheduled job.

But we have to pass a GR object anywany in eventQueue method for notification to be triggered. So, what's the best practise here. should we pass any random object?

 

https://www.servicenow.com/community/developer-forum/queue-an-event-without-the-current-record/m-p/1...