Constantly daily update record in "updated" and "updated by" field possible cause from daily scheduled job script?

bbf3562
Kilo Guru

We have odd minor issue in this group like this,

update.jpg

Notice that in red circle was recently updated by me but I never touch that group. I was wondering if that was cause by daily schedule job script created by me that run on [sys_user_group] table to update some value in specific fields that cause trigger on audit update? If so then will use gr.setWorkflow(false); in script work to prevent that audit trail updated and updated by?

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi Bradley,



It is very likely that your scheduled job is doing this. Rather than setWorkflow(false), try autoSysFields(false).



setWorkflow() controls whether business rules and workflows will be triggered when the record is updated.



autoSysFields() determines if the times, counts, (and I believe updated by) are updated.


View solution in original post

11 REPLIES 11

It works like this also, just mark it once for the whole transaction.



var rec = new GlideRecord('some_table');


      rec.addQuery('active', true); // example


rec.autoSysFields(false); // do not update automatic fields - leave no footprints


      rec.query();



      while (rec.next()) {


            //do something


            rec.update();


      }


-Anurag

Good to know. I haven't tried it that way. Thanks.