0 votes
in Service Now by
What is the usage of the setForceUpdate() function?  Is it possible to update a record without updating its system fields such as sys_updated_by, sys_updated_on, etc.?

1 Answer

0 votes
by
The setForceUpdate() function is used to update the record even if there are no changes on the record. Yes. It is possible to update a record without updating its system fields. For this, you have to use the function autoSysFields() in your server-side scripting. Whenever you are updating a record, set the autoSysFields() to false.

Example:

var gr = new GlideRecord('incident');  

gr.query();  

if(gr.next()){  

gr.autoSysFields(false);  

short_description = "Test from Examsmyntra" ;  

gr.update();  

}

Related questions

0 votes
asked Oct 5, 2023 in Service Now by john ganales
0 votes
asked Jan 3 in MariaDB by rajeshsharma
...