how to update "updated by" field.

mv
Tera Contributor

i'm creating incident record from the workflow , i want to set the "updated by" field as some default user name.when ever the incident is created the updated by field is updated as "system".

2 REPLIES 2

Joe McCarty1
ServiceNow Employee
ServiceNow Employee

You can possibly use autoSysFields function on the GlideRecord to disable the system set fields (GlideRecord - ServiceNow Wiki ).   Some others seem to have had success doing what you described, but you are turning it off for all the system set fields.



IS it possible to overrule the Gliderecord sys_updated_by during updates.


kalyan778
Mega Guru

Hi Mohana,



Use the below sample code to achieve that functinality,but you need to fill all the system fields.



var gr=new GlideRecord('incident');


gr.initialize();


gr.autoSysFields(false);


gr.sys_updated_by='testuser';


gr.insert();



Thanks