Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs
6 votes

How to make a call out after every DML in batch

The basic answer is "you can't." DMLs block callouts, so if you need this kind of behavior, you have to arrange an alternative solution. I solved this very problem in a different manner once....
sfdcfox's user avatar
  • 494k
4 votes
Accepted

Can't delete Apex class from production, deployment fails with "This Batchable class is in use. : Apex Sharing Recalculation", but no job queued?

When I checked the "apex jobs" page, filtering by status, I couldn't see any jobs pending. However, when I queried them with the Developer Console, some rows were showing as "processing&...
Renato Oliveira's user avatar
3 votes

How to make a call out after every DML in batch

The obvious answer is to invoke a future method or enqueue a Queueable that does the callout. You'd call or enqueue with the required details after each DML in execute. Obviously the future method or ...
Phil W's user avatar
  • 36.7k
3 votes

Batch and custom metadata

It depends on how you write the code. There are three general moments you can set the custom metadata. public class BatchClass implements Database.Batchable<sObject> { CustomMetadata__mdt[] ...
sfdcfox's user avatar
  • 494k
2 votes
Accepted

How to Avoid Heap Size Error on response body

In general, you can dump the unnecessary data to try and get your heap under control. You can do this by adding curly braces around the data you want to unload before Apex realizes you're over the ...
sfdcfox's user avatar
  • 494k
1 vote
Accepted

Apex Batch Question

public class censusUploadBatch implements Database.batchable<List<String>>, Database.AllowsCallouts, Database.Stateful{ Is telling Salesforce that you want a list of list of strings, so ...
sfdcfox's user avatar
  • 494k

Only top scored, non community-wiki answers of a minimum length are eligible