how to update ' sys_updated_by' through workflow

Ashok10
Mega Expert

Hi there,

Actually we have a catalog item in our instance for Employee termination. Once we submit the form by selecting an user to terminate we are deactivating that user in User table.

We have done deactivation of the user in workflow Run scripts, the script is working fine its deactivating the user. But updated by of the user record is showing as whoever is the person submits the form. I need to set updated by here as system.

Could somebody pls let me know how can we do this?

1 ACCEPTED SOLUTION

This will be a little bit of a hack, but it may work...



Dynamically creating a schedule job and add the script in there that does the update . It will be important to later have another script (perhaps in a scheduled job) that purges the schedule jobs you dynamically create.



Thanks,


Berny


View solution in original post

6 REPLIES 6

bernyalvarado
Mega Sage

Hi Sai,



I believe that in your GlideRecord you could use the method .autoSysFields(false); which is going to prevent from the sys_ fields from getting automatically updated. On this case you can then try to assign your desired user to the sys_updated_by field just like you will do with any of the other table fields.



I hope it helps!



Thanks,


Berny


Hi Berny,



Thanks for your reply. Now I am able to update 'updated by' field with value system.


But if we update any work notes it is showing as its updated by logged in user. Is there any way to log the work notes with system account.



Regards,


Ashok Kumar Ambati.


Ashok10
Mega Expert

can smby help here pls


This will be a little bit of a hack, but it may work...



Dynamically creating a schedule job and add the script in there that does the update . It will be important to later have another script (perhaps in a scheduled job) that purges the schedule jobs you dynamically create.



Thanks,


Berny