- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2022 05:52 AM
Hello!
We have a need to update some closed HR Cases with a new close code.
I have written a fix script to update the close code, but its unable to execute due to a data policy.
Is there a method to set data policy to false? I read that setUseEngines cannot be used in a scoped app.
Any ideas?
var hrCase = new GlideRecord('sn_hr_core_case_relations');
hrCase.addQuery('u_close_code',"Written Warining");
hrCase.query();
while(hrCase.next()){
hrCase.u_close_code="Written Warning";
hrCase.update();
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2022 10:44 AM
You can create and execute your fix script in global scope and then use setUseEngines() method to disable data policy.
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2022 05:59 AM
Hi,
add hrCase.setWorkFlow(false); just before hrCase.update() and try once.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2022 06:58 AM
Unfortunately, no luck.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2022 10:37 AM
Hi,
It'd be helpful to know what the data policy is checking for/enforcing?
Alternatively, you may want to convert the policy to a business rule, etc. instead.
or disable it for this moment, run fix script, then turn it back on.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2022 05:39 PM
Hi
Thanks for marking my reply as Helpful.
If a particular reply helped guide you Correctly, please also mark it as Correct.
Thanks and take care! 🙂
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!