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
Prateek Kumar 11Prateek Kumar 11 

Send one email per data load job

Hi All, 

I have got a situation here. I'm our org we need to provide status via email when a data load completes. The data load job updates the owner on a particular object(say account)  and the trigger on that object then fires a queueable to update the owner on an object records related to the account. Once this queueable completed, it enqueues another queueable to change owner for another object records related to the account. 
For any errors that are occurring in this complex process we are storing those in a custom object. 
Currently, I have created a solution that sends an email when the final queueable completes. However, the problem arises when we do a data load to change the owner on accounts. Since, Salesforce breakdowns the records into batches of maximum 200 each we receive multiple emails depending on the number of batches. 
The solution I'm looking for is to send 1 email for the entire data load job .

Could anyone help me find a solution to this. 

Thanks 
 
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Prateek, Hope it will be helpful.

Please mark it as best answer if the information is informative.

Thanks
Rahul Kumar