Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Certified Platform Developer II All Questions

View all questions & answers for the Certified Platform Developer II exam

Exam Certified Platform Developer II topic 1 question 78 discussion

Actual exam question from Salesforce's Certified Platform Developer II
Question #: 78
Topic #: 1
[All Certified Platform Developer II Questions]

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.setEndpoint('http://example.org/ restService'); req.setMethod('POST'); req.setBody(JSON.serialize(acc)); HttpResponse res = h.send(req); } }
What LimitException could the following code trigger?

  • A. System.LimitException: Too many future calls
  • B. System.LimitException: Too many callouts
  • C. System.LimitException: Too many SOQL queries
  • D. System.CalloutException: Callout from triggers are currently not supported
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
thekumarakshay
10 months, 3 weeks ago
D is not of type limit exception. Hence, A.
upvoted 1 times
...
santo_aj
1 year, 6 months ago
Selected Answer: D
D is the correct answer because notinyxternalSystem is not marked as @future. So it was fun pulling this apart to be able to read it. Yes, it is written incorrectly. The 'callout=true' is on the wrong line is missing @future. I filled in the gap knowing the intention. So let's look at the governor limits and see what hits first. SOQL Query: 100 per transaction Callouts: 100 per transaction @future: 50 per transaction The too many future callouts hits first, hence A. THAT is what this question is asking about. In reality, as is, I don't believe the code will even compile. Reference: https://developer.salesforce.com/docs/atlas.en-us.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_apexgov.htm
upvoted 1 times
...
Segre
1 year, 8 months ago
Selected Answer: A
if the syntax for annotation is fixed to @future(callout=true) then the answer is A - SOQL is used in future so it's a different transaction with a separate 200 limit - 100 callouts again from single transaction, not an issue and the winner is future invocation , which could be only 50
upvoted 1 times
...
lorenac2
1 year, 10 months ago
Selected Answer: A
So it was fun pulling this apart to be able to read it. Yes, it is written incorrectly. The 'callout=true' is on the wrong line is missing @future. I filled in the gap knowing the intention. So let's look at the governor limits and see what hits first. SOQL Query: 100 per transaction Callouts: 100 per transaction @future: 50 per transaction The too many future callouts hits first, hence A. THAT is what this question is asking about. In reality, as is, I don't believe the code will even compile. Reference: https://developer.salesforce.com/docs/atlas.en-us.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_apexgov.htm
upvoted 3 times
...
mageshrr
2 years, 1 month ago
It has been tested and the correct answer is D.
upvoted 1 times
...
Peter808
2 years, 1 month ago
Selected Answer: D
https://help.salesforce.com/s/articleView?id=000330691&type=1
upvoted 1 times
...
agjklsjrhgjksf
2 years, 6 months ago
Selected Answer: B
B Because without implementing Database.AllowCallouts callout limit is 0 https://salesforce.stackexchange.com/questions/31859/too-many-callouts-1-in-salesforce-batch
upvoted 1 times
lorenac2
1 year, 10 months ago
It's not a batch class; this is used with asynch classes.
upvoted 1 times
...
...
skipper009
2 years, 10 months ago
This question is confusing because it's not even a valid code. But if we stick to the question, it should be A since D is not a LimitException.
upvoted 1 times
...
drwebber
2 years, 11 months ago
Selected Answer: D
notinyxternalSystem is not marked as @future. 'Callout from triggers are currently not supported' error will occure. https://help.salesforce.com/s/articleView?id=000330691&type=1
upvoted 4 times
...
nibbio
2 years, 11 months ago
Too many future calls limit (per transaction): 50 will be fired before the other ones.
upvoted 3 times
...
AnhTH
3 years, 1 month ago
D is correct answer
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...