The CreatorCon Call for Content is officially open! Get started here.

Operations against 'sys_attachment' table not allowed for scoped applications?

ericeger
Tera Guru

I have been working on the following process

1. Create a request item with an attachment

2. Create a business rule that create a record on a table in my scoped application, which has a reference to the request item

3. Business rule(after insert) gets the attachments linked to the request item, and duplicates the attachments using the newly created record and its table name.

I get the 3 following errors

Access to api 'put(sys_attachment.table_name)' from scope 'x_mpaii_sharepoint' has been refused due to the api's cross-scope access policy

Access to api 'put(sys_attachment.table_sys_id)' from scope 'x_mpaii_sharepoint' has been refused due to the api's cross-scope access policy

Create operation against 'sys_attachment' from scope 'x_mpaii_sharepoint' has been refused due to the table's cross-scope access policy
 
 
What I've done to help is create sys_scope_privilege records for the 'sys_attachment' table on behalf of my scoped application for read/write/create. I've also created table sys_scope_privilege records for write access on the two field names. Additionally, I created two more executable sys_scope_privilege records on the exact name above (put(sys_attachment.table_sys_id)). I've also gone into the sys_attachment table and allowed 'Can Read/Write/Create'. Both tables can be accessed by all application scopes. I'm using an admin id, so ACLs not should be an issue. 
 
I deactivated my business rule in step 2. I went and re-created the same business rule in the Global application and ran it just like step 3 and works as expected with creating the sys_attachment record. I then deactivated the business rule in the Global application and re-activated the one in the scoped application. I get the same 3 errors noted above.
 
Is there something else that I might be missing? Are there other sys_scope_privilege records I could try to make?
 
Thanks
9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Do have a look on the application access settings for sys_attachment table; in order that other scope app script can read, create, delete, update; the checkboxes should be set to true for individual operations

find_real_file.png

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

I have gone in and done this already for Read/Write/Create and have had no lucks. Thanks for the suggestion though.

Eric

Hi,

What is the script you are trying to run?

Regards

Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

ericeger
Tera Guru

I actually found the answer to my question - on the sys_attachment table, I needed to enable 'Allow configuration' as well. This is something that I have not found on other questions, so hopefully it helps someone one