I am new to Salesforce and looking for a solution.
I am writing a Job, which reads lead records more than 1000 using the query and process them in chunks for every 100 and updates them. In the finish, i am sending a email with the status of the job and I also need to know, how many are total records processed by reading the query and how many are updated in each chunk batch apex.
Is there a way to declare the global variable and pass it through all the batch chunk processes and at the end in the finish method it will show us the result.
Appreciate any help!!