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
vasu yadavvasu yadav 

what is the exact difference between future annotation and batch class? which case we would prefer future annotation and which case we would prefer batch class?

Hi, I am new to salesforce and  have some confussion,
what is the exact difference between future annotation and batch class? which case we would prefer future annotation and which case we would prefer batch class?

Thnaks in advance
Best Answer chosen by vasu yadav
Kanika DuaKanika Dua
Hi Vasu

@future method is used when we want to execute a method after some delay.Generally Used in Scenerios while we are working on Setup and Non-setup Objects

Batch Class is Used when we want to process records in Batches to avoid Hitting Governor limits.Like when we want to Update a Field Weekly on all the records we will use batch Class