ApexSensei

Drills Asynchronous Apex

Complete a Contact review in the future

A @future method runs later, in its own transaction.

Your task

Turn the working synchronous method into a @future method, so the review is saved after the caller's transaction ends.

public class AS_A43C82691AAA_FutureContactJob {
    public static void completeReview(Contact contact, String reviewResult) {
        contact.Description = reviewResult;
        update contact;
    }
}

Requirements

  1. storesReviewResult should pass
  2. waitsUntilStopTest should pass
  3. queuesOneFutureCall should pass
  4. changesOnlyProvidedContact should pass

Sign in to open this drill