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)- A8% (3)
- B84% (32)
- C3% (1)
- D5% (2)
Community Discussion
No community discussion yet for this question.