How to restricted the system updated fields when any record get updated.

vinuth v
Tera Expert

Hi All,

 

I want to update the few records in the table but it should not update the system fields like updated.

 

Please any one suggest me how to do this one,

 

Thanks,

Vinuth

6 REPLIES 6

Raphael D_
Kilo Sage

Hi Vinuth
Use *autoSysFields(false)".

BR,
Raphael

Hi @Raphael D_ 

 

I tried in the background script like 

var gr=new GlideRecord('incident');
gr.addQuery('number','INC0010006');
gr.query();
if(gr.next())
{
    gr.short_description="testvinuth12123434";
    gr.sys_updated_on(false);
        gr.update();
}
 
but it is not working as expected.
 
Thanks,
Vinuth

@vinuth v 

Please try with below code:

 

var gr = new GlideRecord('incident');
gr.addQuery('number', 'INC0010006');
gr.query();
if (gr.next()) {
    gr.short_description = "testvinuth12123434";
    gr.setWorkflow(false); // Disable workflows to prevent updating system fields
    gr.autoSysFields(false); // Disable automatic system fields updates
    gr.update();
}

 

Please Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.

 

Thanks

Hi @vinuth v 

please see the example from Maddysunil.
you have to use "gr.autoSysFields(false)" instead of "gr.sys_updated_on(false)".
You can't disable individual sys fields, just all of them.

BR,
Raphael