Updating sys_attachment from a scoped application

MartiNet
Tera Contributor

Hi,

Is it possible to update records in sys_attachments from a scoped application?

I have been trying to use the script in the article at https://community.servicenow.com/community?id=community_question&sys_id=898607c4db666b40d6a102d5ca961952

There seems to a be a problem with cross scope permissions.

I have created read, write, create and delete application cross-scope priviledges from my application to table sys_attachments but still can't write to it.

Is this possible to achieve?

Thanks for reading,

Chris

4 REPLIES 4

asifnoor
Kilo Patron

Sys_attachment is the core table of ServiceNow and by default, it will only have Read access from other application scopes.

If you want this table to be edited from other application scopes, then from Global application scope, you need to visit this table and check "Can Create" or "Can Update" checkboxes and save. Then clear the cache and then try. 

However, this is not recommended as it might cause data inconsistency issues and very insecure.

Best way to go about this is to use Runtime asset tracking feature, which allows accessing data of other application scopes.

Kindly read about this concept here

https://docs.servicenow.com/bundle/london-application-development/page/build/applications/reference/c_CrossScopePrivilegeRecord.html

https://docs.servicenow.com/bundle/london-application-development/page/build/applications/task/set-RCA-level.html

Mark the answer as correct and helpful if this answers or helps you.

Also, note that the change to the Attachment Tables security will not be bundled with your Application.
This means:

  • You'll need a separate Update Set to your App in Global with these changes
  • You'll need to deploy it first
  • Your App cannot be certified on the Store

Thanks


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

MartiNet
Tera Contributor

Thank you for replying so quickly. I will try what you suggested and read up on the Runtime asset tracking feature you mentioned.

I will let you know how I get on.

Chris

Okay.

Kindly mark the answer as helpful and correct if it works.