- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 08:16 AM
I am trying to set up a trigger email whenever an attachment is added for a custom table using the accepted solution here:
Event Registry:
Business Rule:
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:
When I add an attachment to the record, I'm getting this error message:
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 privilegesHow do I resolve this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 08:53 AM - edited 03-07-2023 08:53 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 08:50 AM
Hi @dmullinax , Have a look this post
https://www.servicenow.com/community/developer-forum/widget-gs-eventqueue-throws-error-the-event-is-...
Thank you
