- 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 privileges
How 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:28 AM
The second message actually indicates that a previously missing cross-scope privilege record added after your first attempt. Did you try again since this error? Do you still get the exact same message?
All you need is just adding the missing cross-scope privilege record(s).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 08:35 AM
Here's the results of the second attempt. I'm reviewing your link now...
- 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 09:15 AM
That did it!
(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);