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

How to use setWorkFlow() API in a Scoped Application

Joe83
Kilo Contributor

Hi ServiceNow Community Developers,

I have a very simple business rule in scoped application that is using a setWorkflow() API to disable subsequent business rules so they can't run. I am using it exactly the same way as explained in the developer website for scoped APIs. When I run the business rule though it's throwing the error as shown in the screen shot belowfind_real_file.png

Here is the business rule:

find_real_file.png

Please take a look and advise.

Thanks,

John

10 REPLIES 10

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

if your business rule in same scope i.e. x_xlbv_xl_release then it should be allowed

if your BR is in another scope then it won't work

Regards
Ankur

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

@Joe 

Refer below link for help

setWorkflow() cross-scope access issue

setWorkflow api cannot be used for cross scoped applications.

Regards
Ankur

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

@Joe 

Hope you are doing good.

Let me know if I have answered your question.

If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Ankur

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

If your query is resolved please close the question by marking appropriate response as correct

Regards
Ankur

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