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
RC_48RC_48 

how to restrict users from updating record that has been picked up by batch job in salesforce

Hi All,

I have a batch class that picks up the pending orders and process them. But on order pagelayout, user is able to modify the order record while the record is picked up by batch job. Can anyone please let me know how to restrict users from updating record that has been picked up by batch job in salesforce.

Regards,
Ragadeep Chaitanya
VinayVinay (Salesforce Developers) 
The batch jobs that are not started yet will stay in queue until they are not started.  Since this is an asynchronous process we are not sure when it will be executing and running batch job.  As a workaround you can try keeping required fields as Read-Only for required profiles.

Thanks,
RC_48RC_48
Hi Vinay,

We are sure the batch job runs at 50th minute of every hour. My requirement is to stop certain users(Profile base) from modifying the record during this batch run(50th minute).

Thanks,
Ragadeep Chaitanya