getRelatedListInfo
Use this wire adapter to get the metadata for RelatedList
.
See Get Related List Metadata.
Parameter Name | Type | Description | Required? |
---|---|---|---|
parentObjectApiName | String | The API name of a parent object that you want to get related lists for, like an Account. | |
relatedListId | String | The API name of a related list object such as Contacts, Opportunities, or Cases. | |
recordTypeId | String | The ID of the parent record type. If not provided, the default record type is used. | |
fields | Array of Strings | The API names of the related list’s fields to query. If the context user doesn’t have access to a field, or if the field doesn’t exist, an error is returned. If you’re not sure whether the context user has access to a field and you don’t want the request to fail if they don’t, use the optionalFields parameter. | |
optionalFields | Array of Strings | The API names of additional fields in the related list to query. If a field is accessible to the context user, it’s included in the response. If a field isn’t accessible to the context user, it isn’t included in the response, but it doesn’t cause an error. | |
restrictColumnsToLayout | Boolean | Indicates whether to retrieve metadata for only the list columns in the page layout (true) or all columns (false). The default value is true. To further filter columns, use restrictColumnsToLayout with fields and optionalFields . |
data
—Related List Infoerror
—FetchResponse
This code example fetches the metadata for the Contacts related list in the Account object, then iterates through the list of display columns.
See Also
- Understand the Wire Service
- Handle Errors in Lightning Data Service
- Salesforce Objects Supported by lightning/ui*Api Modules