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
andyaldis1.3969086903835708E12andyaldis1.3969086903835708E12 

Batch update on activities

I need to write an apex class to do a batch update on activities.  My question is do I need to query Tasks and Events seperately in my class like I would if were using the workbench or can I query all the activites together?  If so how.  I will be writing a batch class to update basically all of our open and closed actvities to update some new lookup fields we recently added.
Amit GhadageAmit Ghadage
Hi andyaldis1,
Please find comments on your questions.
1) do I need to query Tasks and Events seperately?
- Yes you have to query Tasks and Events separately.
2)  can I query all the activites together?
- There is no way to query Task and events together you have to query on both saperately.

Best Regards,
Amit