Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Event Access Error when Setting up Attachment Event

dmullinax
Mega Guru

I am trying to set up a trigger email whenever an attachment is added for a custom table using the accepted solution here:

 

https://www.servicenow.com/community/developer-forum/how-to-trigger-mail-whenever-attachment-is-adde...

 

Event Registry:

event_reg.jpg

 

Business Rule:

bus_rule.jpg

Script:

(function executeRule(current, previous /*null when async*/ ) {
    var incObj = new GlideRecord("x_losls_ogac_ogac_table");
    if (incObj.get(current.table_sys_id)) {
        gs.eventQueue("x_losls_ogac_ogac_table.attachment.add", incObj, current.file_name);
    }

})(current, previous);

 

Notification:

notification.jpg

When I add an attachment to the record, I'm getting this error message:

error.jpg

Error MessageAccess to event 'x_losls_ogac_ogac_table.attachment.add' from scope 'OGAC' has been refused. The event is not defined.
Info MessageExecute operation on API 'Glide API: event management' from scope 'OGAC' was granted and added to 'OGAC' cross scope privileges

How do I resolve this?

1 ACCEPTED SOLUTION

Just noticed that you seem to be using the value from the "suffix" field, but you should actually use the "event name", i.e. x_losls_ogac.x_losls_ogac_ogac_table.att.

View solution in original post

5 REPLIES 5