You need to sign in to do that
Don't have an account?
Luca Debellis
Help with apex Batch ?
Implement a batch that counts the accounts and sends an email with the account number, thanks at all.
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
try following apex Batch Class that sanding email.
above class sanding No Of Accounts Where accountNumber != null
let me know if it helps you and marking it as best so that it can help to others.
Thank you
All Answers
Batch Apex:
A Batch class allows you to define a single job that can be broken up into manageable chunks that will be processed separately.
Here is how to write sample Batch Apex:
1) Start method is automatically called at the beginning of the apex job. This method will collect record or objects on which the operation should be performed. These record are divided into subtasks & passes those to execute method.
2) Execute Method performs operation which we want to perform on the records fetched from start method.
3) Finish method executes after all batches are processed. Use this method to send confirmation email notifications.
Reference:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch.htm
The sample code would like below: To run the Batchable: This Batch apex will count number of Contacts associated with Account object.It will store the count in a field "No_of_Contacts" on Account.And sends an email with provided email addresses with provided content.
Additional Reference:
http://amitsalesforce.blogspot.com/2016/02/batch-apex-in-salesforce-test-class-for.html
Hope above information helps, Please mark as Best Answer so that it can help others in the future.
Thanks.
try following apex Batch Class that sanding email.
above class sanding No Of Accounts Where accountNumber != null
let me know if it helps you and marking it as best so that it can help to others.
Thank you