setWorkflow() cross-scope access issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2019 09:48 AM
I am unable to call setWorkflow() from a scoped application.
I've attached the code that I'm running, as well as an image of the cross-scope access policy and an excerpt from the log.
The ServiceNow documentation clearly states that setWorkflow should be callable from other application scopes. the cross-scope access was granted, however the logs still say that access to the api 'setWorkflow' from my application scope was refused due to the api's cross-scope access policy.
I am at a loss on how to solve this. Has anyone else experienced and solved this?
I had an idea to create a global script include to call setWorkflow, and call that function from my app scope, but it appears that it simply sets setWorkflow for any calls from the Global scope, and everything I'm doing from my app scope still triggers business rules to run.
Thanks,
Robbie
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2019 10:27 AM
Hi,
Lets take an example:
You have global scope and two scoped application.
If you do setWorkflow(false) in global scope it will only stop the business rule execution in that scope and not in other two scoped application. Similarly if you do setWorkflow in one scope app it will only stop BR execution for BR related to that scope and not for global scope and other scope app.
Thanks,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2019 10:31 AM
Ashutosh,
I figured that out when trying to initialize it in another method other than calling it directly in the script. The issue I'm having is calling it in the scoped app is being denied by cross-scope policy, even though its been granted access.
Or are you saying that I cannot call setWorkflow from my scoped app and have it not run business rules that are in another app scope? So for instance, if I have a global business rule and a scoped business rule on the incident table, calling setWorkflow from a scoped app will only turn off the scoped business rule? To me that seems like broken functionality, as the whole point of calling that would be to disable all business rules running on a table regardless of scope.
Thanks,
Robbie

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2021 10:10 AM
Hello Robbie,
Does the problem still persist for you?
If yes, how you did solve it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2023 08:49 PM
In order for a script to execute setworkflow false an entry has to be created in cross scoped access privilege table with source scope as scoped app -> scope of the table on which gliderecord query being executed.
target scope is global and script name will be SetWorkflow