Why is access to api 'setAbortAction' refused from scoped application

amitmparikh
Tera Contributor

Following error is received when accessing current.setAbortAction from a before business rule on sc_task table from within an scoped application,

"Access to api 'setAbortAction' from scope 'x_13487_xxxx' has been refused due to the api's cross-scope access policy"

Is there an alternate way to set abort action from within an application scope?

Amit

1 ACCEPTED SOLUTION

Hi Sergiu,



The system always enforces the following creation restrictions when a developer adds a configuration record belonging to another application scope. Please refer the below link for more info.


Creation Restrictions Across Application Scopes - ServiceNow Wiki


However the link you pointed is correct as we can use abort action on the custom tables created as part of the scoped application(their own scope).



Please let me know if you have any questions.


View solution in original post

9 REPLIES 9

Kalaiarasan Pus
Giga Sage

I haven't worked on scoped app's but Wiki says that it works here


Scoped GlideRecord API Reference - ServiceNow Wiki


Kalai,



Wiki doesnt mention specifically wether it should work with scoped app or not.


After giving it a thought it kind of make sense that it would be restricted since I am trying to call it from a BR on sc_task table which is in the global space.



When I tries it from a business rule on one of the scoped app table it worked.



Amit


Dude. The link is about scoped gliderecord API


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Amit,



That is the expected behavior. You cannot abort the database transaction.


Scoped applications restrictions :


Business Rules
  • You can create a rule where When is async with any of the following options:
    • Insert, Update, and Delete database operations. You cannot select Query.
    • Set field values actions and scripts (the Script field).
  • You can create a rule where When is before with any of the following options:
    • Insert, Update, and Delete database operations. You cannot select Query.
    • Set field values actions only. You cannot write scripts and you cannot abort the database transaction.
  • You cannot create any other type of business rules on tables in another application scope.

I hope this answers your question.