setForceUpdate is not working

jitusingh
Tera Contributor

Hi All,

I have a calculation field which I am trying to overwrite with the actual value for the Effectiveness field.  I am using setForceUpdate but it is not working. The value is not updating.

I am doing through Fix script. Scope : GRC Audit management

var r = new GlideRecord('sn_audit_control_test');
r.addQuery('number','CTR0030018');
r.query();
if (r.next()) {
    r.setForceUpdate(true);
    r.autoSysFields(false);
    r.setWorkflow(false);
    r.update();
}


Thanks in Advance!
1 REPLY 1

Anurag Tripathi
Mega Patron

Hi,

How are you checking whether force update is working or not?

 

Using setForceUpdate and autoSysFields could be contradicting. Force update makes sure the record is updated, even when there is no change in the record, no fields updated, you can check this by checking the updated field, however since you are also using autoSysFields(false), system fields are not getting updated. 

-Anurag