SF-PD2 User Interface Practice Question
A developer is creating a Lightning Web Component that needs to display a list of Contacts for a given Account. The component will be placed on a Lightning record page for Account. The developer wants to use the getRelatedListRecords wire adapter from lightning/uiRelatedListApi to fetch the contacts. Which two parameters are required in the wire configuration object for getRelatedListRecords? (Choose two.)
⚠ Common exam trap
The trap here is assuming that fields or sortBy are required because they are commonly used, when in fact only parentRecordId and relatedListId are mandatory.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
relatedListId
The getRelatedListRecords wire adapter requires two parameters: parentRecordId and relatedListId. parentRecordId identifies the parent record (Account) whose related list is queried, and relatedListId specifies which related list (e.g., Contacts) to retrieve. Optional parameters like fields, sortBy, and pageSize can refine the results but are not mandatory for the adapter to execute.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
sortBy
Why it's wrong here
sortBy is an optional parameter that allows sorting of the related records. It is not required for the adapter to function. The developer can specify a field and direction to sort the Contacts, but omitting it will simply return records in an unspecified order. Since the question asks for required parameters, sortBy is not among them.
- ✗
fields
Why it's wrong here
fields is an optional parameter that specifies which fields to return for the related records. While it is often used to limit the data retrieved, it is not required. If omitted, the adapter returns a default set of fields. In this scenario, the developer can include fields to optimize performance, but the adapter will still function without it, making it not a required parameter.
- ✓
relatedListId
Why this is correct
relatedListId is required to specify the API name of the related list, such as 'Contacts' for the Contacts related list on Account. This tells the adapter which related list to query. Without it, the adapter does not know which child relationship to traverse. The developer must provide the correct related list API name to retrieve the Contacts.
- ✗
pageSize
Why it's wrong here
pageSize is an optional parameter that determines the number of records returned per page. It is not required. The adapter has a default page size if not specified. While useful for pagination control, the adapter will still retrieve records without it. Therefore, pageSize is not a required parameter for getRelatedListRecords.
- ✓
parentRecordId
Why this is correct
parentRecordId is required to specify the ID of the parent record (the Account) whose related list records you want to retrieve. Without this parameter, the wire adapter cannot determine which record's related list to query. In this scenario, the developer must pass the Account ID, typically obtained via @api recordId, to fetch the correct Contacts.
About these practice questions
One of 226 original SF-PD2 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Salesforce exam blueprint
This SF-PD2 practice question is part of Courseiva's free Salesforce certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SF-PD2 exam.