disabling data policy via script

tahnalos
Kilo Sage

Hello

While trying to run a script to reorganize data, I keep running into a Data Policy Error.   I'm not sure what is happening but it would appear that someone modified a data policy on the production system without testing it on the development system first.   Whatever it is, it is preventing the script from updating the data I need to update in the script.

Is there any procedure that I can use to stop data policies from running so the script can run as intended?   GlideRecord.setWorkflow (false) does not seem to have any effect.   This is a one time script so I don't want to change anything or deactivate anything unless it is absolutely necessary.

Thanks

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Tahnalos,



Use GlideRecord.setUseEngines(false); to disable Data policies.


View solution in original post

6 REPLIES 6

Johnny17
Kilo Expert

This does not work for scoped scripts; 

any other solution??...

Hi Johnny,

 

You can create a script include in Global application and then you can call that function inyour BR in scoped application.

BR,

Meenal