useRelatedRecords
Import
import { mix, useRelatedRecords, BoltElement } from 'c/boltage';Usage
export default class myLwc extends mix( BoltElement, useRelatedRecords({ relatedListId, fields, where, sortBy, pageSize, optionalFields })) { }Methods
Constructor(params) : Constructor
| Name | Type | Description |
|---|---|---|
relatedListId | string | List of import fields |
fields | Field[] | String[] | List of imported fields or list of field path as strings |
where? | string | Filtering condition |
sortBy? | string | Sorting logic |
pageSize? | number | Pagination option |
Example
import FirstName from '@salesforce/schema/Contact.FirstName';export default class myLwc extends mix( BoltElement useRelatedRecords({ relatedListId: 'Cases', fields: [FirstName] })) { parentRecordId = 'XXXX'; }Dynamic Attributes
<relatedListApiName> : Record[]
Example
import FirstName from '@salesforce/schema/Contact.FirstName';export default class myLwc extends mix( BoltElement useRelatedRecords({ relatedListId: 'Cases', fields: [FirstName] })) { parentRecordId = 'XXXX'; doSomething() { this.Contacts.forEach(contact => console.log(contact.FirstName) ); } }