function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ShikhaJainShikhaJain 

In which Users Perspective does a Data.com Clean Job run?

Hi All,

We have a requirement where based on the Last Modified User we need to set the Priority value in a custom Field. However, we are doing this in the Before Update Event and hence are not getting the value for the Last Modified By in the Trigger.new. Can you please help us understand in which user's perspective would the Data.com Clean Job run so that we can Identify that the record was updated by a Data.com Clean Job.

What would be the value that UserInfo.getUserId() return in the before update event in this case as the data.com Clean Job runs in the background?

Thanks in advance.
SandhyaSandhya (Salesforce Developers) 
Hi,

Usually,UserInfo.getUserId(); will update the owner ID as current logged user who is updating the custom field in the trigger.

Please refer below link.

https://developer.salesforce.com/docs/atlas.en-us.202.0.apexcode.meta/apexcode/apex_methods_system_userinfo.htm


https://help.salesforce.com/HTViewHelpDoc?id=data_dot_com_clean_admin_set_up_clean_jobs.htm&language=en_US
 
​Hope this helps you!

Thanks and Regards
Sandhya
ShikhaJainShikhaJain
Thanks Sandhya for the reply.

We are aware that UserInfo.getUserId() will give the logged in users details. However, the question is that in which users perspective does an automated job run. We have scheduled a job to run every night 9pm then at that time it will automatically start executing the job. So will it take the permissions and settings for the user who had submitted the request or some other user.