Certified Platform Developer II Exam QuestionsBrowse all questions from this exam

Certified Platform Developer II Exam - Question 38


Which two relationship queries use the proper syntax? (Choose two.)

Show Answer
Correct Answer: CD

The proper syntax for relationship queries in Salesforce must adhere to the API name conventions and proper SOQL syntax. First, the relationship name for standard objects does not include ‘__r’. For querying parent fields from the child object, you use the dot notation (Account.Name) which makes option D correct. For subqueries, such as retrieving child records, you use the relationship name (Contacts) without the '__r' suffix, making option C correct. Therefore, options C and D both use the proper syntax for relationship queries in Salesforce.

Discussion

2 comments
Sign in to comment
costansinOptions: CD
Feb 22, 2023

C,D. Account is a standard field on contact, so no __r

Jeet89123Options: CD
May 29, 2024

CD as Account is standard object and Contact is child object