Skip to content

useRecordsFields

Import

import { mix, useRecordsFields, BoltElement } from 'c/bolt';

Usage

export default class myLwc extends mix(
[useRecordsFields, fields],
BoltElement
) { }

Methods

Constructor(fields) : Constructor

NameTypeDescription
fieldsField[][]List of imported fields

Example

import FirstName from '@salesforce/schema/Case.Contact.FirstName';
import ContactId from '@salesforce/schema/Case.ContactId';
import LastName from '@salesforce/schema/Account.LastName';
export default class myLwc extends mix(
[useRecordFields, [
[FirstName, ContactId],
[LastName]
]],
BoltElement
) {
recordIds = {
CaseId: 'XXXXX',
AccountId: 'YYYYYY'
};
}

Dynamic Attributes

<objectApiName> : Record

Example

import FirstName from '@salesforce/schema/Case.Contact.FirstName';
import ContactId from '@salesforce/schema/Case.ContactId';
export default class myLwc extends mix(
[useRecordFields, [FirstName, ContactId]],
BoltElement
) {
@api recordId;
doSomething() {
console.log(this.Case.Contact.FirstName);
console.log(this.Account.LastName);
}
}