Salesforce
PDII · Question #59
PDII Question #59: Real Exam Question with Answer & Explanation
The correct answer is D. System.CalloutException: Callout from triggers are currently not supported4. See the full explanation below for the reasoning.
Question
A company requires an external system to be notified whenever an account is updated. trigger AccountTrigger on Account (after update){ for (Account updatedAccount:Trigger.new) { AccountTriggerHelper.notinyxternalSystem(updatedAccount.id); } } public class AccountTriggerHelperfuture(callout=true) { public static void notinyxternalSystem(Id accountId){ Account acc = [Select id, name from Account where accountId = :accountId]; http objectHttp h = new Http(); HttpRequest req = new HttpRequest(); req.setBody(JSON.serialize(acc)); HttpResponse res = h.send(req); } } What LimitException could the following code trigger?
Options
- ASystem.LimitException: Too many future calls
- BSystem.LimitException: Too many callouts
- CSystem.LimitException: Too many SOQL queries
- DSystem.CalloutException: Callout from triggers are currently not supported4
Community Discussion
No community discussion yet for this question.