getRelatedListInfo

Use this wire adapter to get the metadata for RelatedList.

See Get Related List Metadata.

Parameter NameTypeDescriptionRequired?
parentObjectApiNameStringThe API name of a parent object that you want to get related lists for, like an Account.Yes
relatedListIdStringThe API name of a related list object such as Contacts, Opportunities, or Cases.Yes
recordTypeIdStringThe ID of the parent record type. If not provided, the default record type is used.
fieldsArray of StringsThe 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.
optionalFieldsArray of StringsThe 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.
restrictColumnsToLayoutBooleanIndicates 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.

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