Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

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