Salesforce Certified Platform Developer II — Question 188

A developer is writing code that requires making callouts to an external web service.
Which scenario necessitates that the callout be made in an @future method?

Answer options

Correct answer: A

Explanation

The correct answer is A because Apex triggers are synchronous and cannot make callouts directly; they need to be handled asynchronously with @future methods. Option B is incorrect since callouts in test classes are allowed without needing @future. Option C is incorrect because callouts taking longer than 60 seconds would not automatically require an @future method, and option D is incorrect as there's a limit on callouts but it doesn't necessitate an @future method.