You need to sign in to do that
Don't have an account?
Prasad S
Lock Batch records
Hi,
Is it possible to lock records which are being processed by Batch?
Or Is there a way to restrict the user from edit when the records are processed through batch?
Thanks in advance
Follow the below steps -
1. create one new field on Object say "Is Checked?"
2.Update this field to TRUE in your Batch Job.
3.Write a Validation Rule with code as below -
PRIORVALUE( Is_Checked__c) = TRUE && Is_Checked__c = TRUE
If someone tries to edit this record when Is checked = true, it will throw an error.
Raji M
All Answers
Please find the below link for different ways to lock the record. I hope this might help you.
https://sfdcfanboy.com/2017/04/26/7-ways-to-lock-a-record-in-salesforce/
Thanks,
Raji M
Thanks for your response. I need to lock records in the Batch which is not mentioned in the link.
Thanks,
BM
Follow the below steps -
1. create one new field on Object say "Is Checked?"
2.Update this field to TRUE in your Batch Job.
3.Write a Validation Rule with code as below -
PRIORVALUE( Is_Checked__c) = TRUE && Is_Checked__c = TRUE
If someone tries to edit this record when Is checked = true, it will throw an error.
Raji M
Thanks Raji
Will try the same