- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2015 07:47 AM
I am doing a POC to fire a daily email notification using Schedule Jobs, Below is my script
try { | |
var target = new GlideRecord('my_table'); | |
target.addQuery('state', 1); | |
target.query(); // Issue the query to the database to get relevant records | |
while (target.next()) { | |
gs.info(target.number); | |
gs.eventQueue("my_eventt", current, gs.getUserID(), gs.getUserName()); | |
} |
}
catch(ex) {
var message = ex.getMessage(); |
}
Which works fine , Now when i am sending a notification i want include current record details in that email , how can i achieve this?
Solved! Go to Solution.
- Labels:
-
User Interface (UI)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2015 07:51 AM
If this is from a scheduled job, then current doesn't refer to anything. You want to pass the gliderecord object in the second argument of gs.eventQueue(), so I would write that line like this:
gs.eventQueue("my_eventt", target, gs.getUserID(), gs.getUserName());
Then you can reference any of the fields from that record in the notification.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2015 07:51 AM
If this is from a scheduled job, then current doesn't refer to anything. You want to pass the gliderecord object in the second argument of gs.eventQueue(), so I would write that line like this:
gs.eventQueue("my_eventt", target, gs.getUserID(), gs.getUserName());
Then you can reference any of the fields from that record in the notification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2015 08:06 AM
Thanks, than in notification should i say target.my_column or ${target.my_column} ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2015 08:19 AM
In the notification you would just do ${my_column} or you can reference it with current. The notification objects don't change no matter what the name of the object you pass is.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2015 08:26 AM
Brad Tilton (Cloud Sherpas) Thank You Sir