lightning/stateManagerRelatedListRecords
This state manager gets 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.
Related list records depend on the parent record ID and related list ID. All other parameters are optional.
setConfig()Provide the entire configuration as an object. This function is equivalent to the factory function when you create the state manager.
setParentRecordId()Set the ID of the parent record that you want to get related lists for, like an Account ID.
setRelatedListId()Set the 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__rformat, whereCustom_Objectsis the plural form of your custom object name, and__ris the related list suffix. For more information on retrieving all related lists for an object or custom object, seeRelatedListDefinition.setFields()Set the API names of the related list’s column fields. To use a standard field on a custom object, use the
Custom_Object__c.FieldNameformat. To use a custom field on a custom object, use theCustom_Object__c.FieldName__cformat.setOptionalFields()Set the API names of additional fields in the related list.
setPageSize()Set the number of list records to return per page. The default value is 50. Enter a value between 1 and 1999.
setSortBy()Set the array of field API names to sort the related list by. Accepts only one value per request.
setWhere()Set filter to apply to related list records. Semi-joins and anti-joins filters are currently not supported. For example, passing in a query using
inqresults in a Malformed Join Input Object error.
statusThe current status of the state manager. See
statusfor details.dataWhen
statusis "loaded", aRelated List Record Collection.errorWhen
statusis "error", this property contains details. Seeerrorfor details.
See Also
- getRelatedListRecords wire adapter
- User Interface API Developer Guide: Get Related List Records with a Request Body