getRelatedListInfo

Use this wire adapter to get the metadata for RelatedList.

See Get Related List Metadata.

  • parentObjectApiName—(Required) The API name of a parent object that you want to get related lists for, like an Account.
  • relatedListId—(Required) The API name of a related list object such as Contacts, Opportunities, or Cases.
  • recordTypeId—The ID of the parent record type. If not provided, the default record type is used.
  • fields—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—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—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.

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