You need to sign in to do that
Don't have an account?
Prince Pranav
Batch Apex Class On Account
Create a Batch Apex Class on Account object… Fetch all the Accounts… If Account Type = ‘
Customer - Direct’ then Update the all the child contacts Status field = ‘Signed Off’. Send an email after all the processing. This email should contain the statistics like Processed records count.
Please try the below batch Class:
Hope this will be helpful.
Thanks.
All Answers
There is an excellent guidance on how to use Batch Apex in Trailhead. Check the section "Using State in Batch Apex" to get the idea on how to calculate the processed records.
https://trailhead.salesforce.com/en/content/learn/modules/asynchronous_apex/async_apex_batch
Email sending is very well described in the following reference document:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_email_outbound_single.htm
With these resource you should be able to proceed.
Regards,
mirki
Please try the below batch Class:
Hope this will be helpful.
Thanks.