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
Hithesh SaicharanHithesh Saicharan 

Update particular field depending on a date field

I am having a drop down field with values Visiting today, going to visit, 1 day after visit and so on .Depending on date I want to update that field. Say if suppose user signed today I have to show Visiting today. This I must not calculate during login. Because if user might not login also in back ground the value has to be changed because of report generation.
I tried with Flow for this scenario but things are not working as expected. If I go with scheduler and batch class whether performance issue will happen. Because now I am having 1000 records. What if the record grows after five years? How to overcome the performance issue if lakhs of records comes in future?
Best Answer chosen by Hithesh Saicharan
VinayVinay (Salesforce Developers) 
Hi Hithesh,

You can use batch apex it can update upto 50million records. Batch Apex is asynchronous execution of Apex code, specially designed for processing the large number of records and has greater flexibility in governor limits than the synchronous code.

Reference:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,