Audit history is not captured when bulk records are updated through fix script.

Community Alums
Not applicable

HI,

 

I am trying to update 3 fields on 6k records through fix script , but audit history is not captured on few records and it is causing to revert back the value to empty by other sources .

 

Kindly help how to fix the issue.

 

Thanks,

Prakash.

11 REPLIES 11

Community Alums
Not applicable

Hey @AnveshKumar M ,

 

No ,  I have not used setworkflow(false), sysautofields(false) in my fix script.

 

Thanks,

Prakash.

SteveMacWWT
Kilo Sage

Prakash - are you able to manually update those fields and save? From the sounds of it ("...not captured on few records, revert back the value to empty...") you have something (BR, ACL, Data Policy) that is not allowing these updates. 

Natascha deJ
Tera Contributor

Hi! Did you ever find out more about the issue? And would you mind sharing what you know? I have seen a comparable issue. 

Hi @Natascha deJ ,

 

You can check below if audit history didnt get created.

 

1. If setworkflow(false) or sysautofields(false) used in your script then it wont create audit.

2. Table audit is disable then wont create audit history.

3. no_audit configured at dictionary level then wont create audit history.

5. Table should not have type field as collection then wont create audit history.

 

RunjayPatel_1-1730452968527.pngRunjayPatel_2-1730452989216.pngRunjayPatel_3-1730453014162.png

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

 

 

 

 

 

 

Hi! 
Thank you very much for your reply. In the meantime we had identified the issue. It was indeed due to the setWorkflow(false), which was called in a while loop - in an if statement. And because it wasn't set to true after the update, once it would be evaluated false, it remained false for the rest of the while loop.