Skip to content

useRecordFields

Import

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

Usage

export default class myLwc extends mix(
[useRecordFields, 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';
export default class myLwc extends mix(
[useRecordFields, [FirstName, ContactId]],
BoltElement
) {
@api recordId;
}

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);
}
}