nerdexam
Salesforce

PDII · Question #54

A developer is working on code that requires a call to an external web service from a batch. How should the developer enable this functionality?

The correct answer is B. Include Database.AllowCallout() in the class definition. See the full explanation below for the reasoning.

Question

A developer is working on code that requires a call to an external web service from a batch. How should the developer enable this functionality?

Options

  • AImplement a custom System.CalloutException class
  • BInclude Database.AllowCallout() in the class definition
  • CImplement an @future method for the callout, and invoke it from the batch
  • DSpecify "callout=true" in the batch implementation

How the community answered

(38 responses)
  • A
    8% (3)
  • B
    84% (32)
  • C
    3% (1)
  • D
    5% (2)

Community Discussion

No community discussion yet for this question.

Full PDII Practice