You need to sign in to do that
Don't have an account?
Jason Kuzmak 12
Send bulk incoming records to batch apex
Hi all,
I have a ton of code that parses a CSV file of accounts coming from another database (via email services). These sheets can be quite large, and I thought it would be a good time to experiment with apex batch processing.
The trouble is, it looks like all of the examples of apex batches involve a query in the Start method. I don't need to query my accounts; I already have everything broken up into lists, and I want all of the dml for these records to occur in smaller batches.
Can this be done via batch apex, or is some other method better?
I have a ton of code that parses a CSV file of accounts coming from another database (via email services). These sheets can be quite large, and I thought it would be a good time to experiment with apex batch processing.
The trouble is, it looks like all of the examples of apex batches involve a query in the Start method. I don't need to query my accounts; I already have everything broken up into lists, and I want all of the dml for these records to occur in smaller batches.
Can this be done via batch apex, or is some other method better?
You can pass the list of records to the batch and batch will work on those records only.
Here is an example for your reference.
Link for your reference:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm
Regards,