ApexSensei

Drills Asynchronous Apex

Carry Account work in a Queueable

A Queueable job keeps state in its fields and runs execute later, outside the current transaction.

Your task

Complete execute so the job labels every Account whose Id is in accountIds, with one query and one update.

public class AS_BDD2EE486035_QueueableAccountJob implements Queueable {
    private Set<Id> accountIds;
    private String reviewLabel;

    public AS_BDD2EE486035_QueueableAccountJob(Set<Id> accountIds, String reviewLabel) {
        this.accountIds = accountIds;
        this.reviewLabel = reviewLabel;
    }

    public void execute(QueueableContext context) {
    }
}

Requirements

  1. updatesEveryAccount should pass
  2. carriesConstructorLabel should pass
  3. leavesOtherAccountsAlone should pass
  4. updatesTwoHundredWithOneUpdate should pass
  5. waitsForTheJobToRun should pass

Sign in to open this drill