Skip to content

Instantly share code, notes, and snippets.

@arun12209
Created January 15, 2023 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arun12209/b2c759b4c44de52bade638127ed1bd9e to your computer and use it in GitHub Desktop.
Save arun12209/b2c759b4c44de52bade638127ed1bd9e to your computer and use it in GitHub Desktop.
import { wire } from 'lwc';
import { getRecord } from 'lightning/uiRecordApi';
export default class MyComponent extends LightningElement {
@api recordId;
@track error;
@wire(getRecord, { recordId: '$recordId', fields: ['Account.Name'] }, {
error: this.handleError
})
account;
handleError(error) {
this.error = error;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment