Help with error "getEventTarget() called with invalid record reference"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2018 03:11 AM
Hi,
I've created a new 'Scheduled Job' that runs every hour with the following code:
var myQuery = 'inc_company!=d6417bf56c5b3100a9474cdec0731892^inc_priorityIN1,2^inc_stateNOT IN6,7^taskslatable_sla.condition_class=d8e775510a0a2c9429616e9a8b7b6f15';
var myInc = new GlideRecord('incident_sla');
myInc.addEncodedQuery(myQuery);
myInc.query();
while (myInc.next()) {
gs.eventQueue('bt.ssoc.mim.alert', myInc, '', '');
I've set the 'run as' to the System Administrator user.
Unfortunately it is throwing an error - e.g.
getEventTarget() called with invalid record reference: incident_sla.722cb3c2373747005a5c5aa5 for event: bt.ssoc.mim.alert, could have been deleted
for each record that it finds in the above query.
I did notice that, because I'm querying the 'incident_sla' table, that there are 2 sys_ids relating to the selected records.
We operate a domain separated instance but the System Administrator user has access to all domains.
Can anyone see a problem with the event queue statement above?
Many thanks in advance,
Keiron.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2018 03:22 AM
kindly refer the below kb article
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2018 03:30 AM
Thanks for the quick reply Harshvardhan.
I did see that article but, as their is no proposed workaround, I thought I'd pose the question to the community.
I'm assuming that this error is actually generated by the attempted event queue statement?
I use the event in an email notification to send out emails but I guess the event hasn't been passed to the notification because of this error?
Thanks again,
Keiron..

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2018 03:33 AM
can you try to pass the value in 3rd and 4th parameter in event queue function..
gs.eventQueue('bt.ssoc.mim.alert', myInc, gs.getUserID(), gs.getUserName());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2018 04:06 AM
Thanks again for the reply.
Unfortunately that still generated the same error.
Again, I wonder if this is because I'm querying a database view (incident_sla) - perhaps I should query the task_sla table?