Hot answers tagged


The main flag that can tell you a retry has happened, is that a new ID you stashed in a static variable is no longer valid. If your trigger code creates any new records you could check those IDs against the DB. I wish Salesforce gave us a better way to do this. One crafty way I thought of in another thread was to enqueue a disposable Queueable class, for no ...


The issue arises because you haven't inserted test data. I recommend you insert it in @TestSetup method of your TestClass. In the very basic case you can do it next way: @IsTest public with sharing class TestClass { @TestSetup static void dataSetup() { ContentVersion contentVersion = new ContentVersion(); contentVersion.PathOnClient ...


One what to do this is with continuations. It's a callback mechanism that is built into Visualforce. See Make Long-Running Callouts from a Visualforce Page. You can also use them from Lightning - Invoking Apex Continuations from Lightning Components. Or a more official version from Summer '19 - Make Long-Running Callouts with Continuations.

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