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

class or batch job

I want a cyclic evaluation of my custom object order to the price, tax, etc.
For this I need to query some 10000 records and calculate.
Which way is better? Creating a class or batch job?
Is there a bestpractice?

If you are just querying and not making an y delete/insert/update on 10000 records in one go then you can go for apex class, no batch required.

Please read following thread for a better understanding:
I want out of 10000 records add up some fields and create a total invoice per account.
Is it a problem if there are 100000 and more records?