getRelatedListRecords

Use this wire adapter to get RelatedList records. Related lists display details and links to records that are associated with a specific record. For example, an account can have related lists for contacts, cases, notes, or even files.

See Get Related List Records with a Request Body.

The /ui-api/related-list-info/${parentObjectApiName} resource returns related lists for an object, including the relatedListId values.

Parameter NameTypeDescriptionRequired?
parentRecordIdStringThe ID of the parent record that you want to get related lists for, like an Account ID.Yes
relatedListIdStringThe API name of a related list or child relationship, like Contacts, Opportunities, or Cases. To provide an API name of a related list custom object, use the Custom_Objects__r format, where Custom_Objects is the plural form of your custom object name, and __r is the related list suffix. For more information on retrieving all related lists for an object or custom object, see RelatedListDefinition.Yes
fieldsString[]The API names of the related list’s column fields. To use a standard field on a custom object, use the Custom_Object__c.FieldName format. To use a custom field on a custom object, use the Custom_Object__c.FieldName__c format.
optionalFieldsString[]The API names of additional fields in the related list.
pageSizeNumberThe number of list records to return per page. The default value is 50. Enter a value between 1 and 1999.
sortByString[]An array of field API names to sort the related list by. Accepts only one value per request.
whereStringThe filter to apply to related list records. Semi-joins and anti-joins filters are currently not supported. For example, passing in a query using inq results in a Malformed Join Input Object error.

This code example fetches the related list records by parent ID and related list object, then iterates through the list of records.

See Also