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
davidjbbdavidjbb 

Apex Scheduler

Hello Community

 

If I write an Apex Scheduler to create a bunch of records at X day at Y Time.

 

When these records are created. Who would be the ownership of the Records? ie. Created By and Modified would be..?? 

(If I did not set these fields)

 

Would it be the person who sets the Scheduled Job?

 

Thank you,

davidjbb

Best Answer chosen by Admin (Salesforce Developers) 
Saikishore Reddy AengareddySaikishore Reddy Aengareddy

Yes you are correct. ownership, createdby and lastmodified will be the user who schedules the job... But you can always define the owner when creating records sy setting ownerId field.