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

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam Certified Platform Developer II topic 1 question 309 discussion

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

A developer has a requirement to query three fields (Id, Name, Type) from an Account; and first and last names for all Contacts associated with the Account.

Which option is the preferred, optimized method to achieve this for the Account named 'Ozone Electronics'?

  • A.
  • B.
  • C.
  • D.
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
tester1987
3 months ago
Selected Answer: B
D will throw error 'List has no rows for assignment to SObject' , as you are storing the list of Accounts into a variable
upvoted 1 times
...
Sapphire808
6 months ago
D. B does not work, it returns unknown parsing error, and D is the simplest to execute.
upvoted 1 times
M4JK3LSON
3 months, 1 week ago
It doesn't returns any mentioned by you error, B is correct answer and consume just 1 soql instand of 2 like in D answer
upvoted 1 times
...
...
BrucePark
7 months, 2 weeks ago
There is a same question previously. The answer was D.
upvoted 1 times
...
Ike300
11 months, 3 weeks ago
Selected Answer: B
Parent to child query can do this in one shot which is optimized
upvoted 3 times
...
Ullr
1 year ago
B and it works
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 ...