The CreatorCon Call for Content is officially open! Get started here.

Need help on disabling the updated by while running fix script

shaik_irfan
Tera Guru

Hi,

 

I am running Fix Script whoever runs the fix script it is updating on the user name who updated the script.

 

I want to display it as system

 

Can anyone please help me how to do this ?

 

I know we can use "autoSysFields(false);" but it is disabling sys_updated_by, sys_updated_on, sys_mod_count, sys_created_by, and sys_created_on 

 

for me i just want to disable sys_updated_by field it should track when it was updated. can anyone please help me how to do this ?

 

6 REPLIES 6

Unfortunately No. Better use Scheduled Job.

Jeffrey Siegel
Mega Sage

In the fix script, try impersonating the user you want the system to show is updating the record.  you can script it to one specific user or via a variable use the person who created the record or what have you...

 

you can use this code to do the impersonation:

var approver1 = '<sys_id of the user you want to impersonate>';
var myUser = gs.getSession().impersonate(approver1); //impersonate user
 
ACTIONS TO BE PERFORMED GO HERE
gs.getSession().impersonate(myUser); //back to normal