wire service adaper in lwc
import { LightningElement, api, track, wire } from 'lwc';
import { getRecord } from 'lightning/uiRecordApi';
export default class WireFunction extends LightningElement {
@api recordId;
@track record;
@track error;
@wire(getRecord, { recordId: '$recordId', fields: ['Opportunity.Name'] })
wiredAccount({ error, data }) {
if (data) {
this.record = data;
} else if (error) {
this.error = error;
}
}
}