- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2021 11:55 AM
hi Stravan, Marek and David,
Today I faced exactly the same issue "Access to api 'setWorkflow' has been refused due to the api's cross-scope access policy."
After analyzing I found the root cause and a solution for it. The root cause is that this function 'setWorkflow' is not supported in a scoped application. I doubt that it is feasible to allow this by configuring a cross scoped privilege as it is not an object (table, script include, ...).
To resolve it, you can create a new script Include in the global scope with a function which has the query and the setWorkflow in it. Then return your response. The setWorkflow can be used to disable Business Rules for Updates, Deletes and Inserts, though also so to circumvent Business Rule Before queries.
The setWorkflow is working 100% in a global scope script include 🙂
Example call:
var glSI = new global.your-global-script-include();
var responseObject = glSI.your-function();
Please mark helpfull or answered when when it does 🙂
regards, Peter