Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. import { LightningElement, api, track, wire } from "lwc";
  2. import { getRecord } from "lightning/uiRecordApi";
  3.  
  4. const FIELDS = [
  5. "Parent__c.Account__r.Name"
  6. ];
  7.  
  8. export default class TestLWC extends LightningElement {
  9. @api recordId;
  10. @track record;
  11.  
  12. @wire(getRecord, { recordId: "$recordId", fields: FIELDS })
  13. wiredRecord({ error, data }) {
  14. if (data) {
  15. this.record = data;
  16. this.error = undefined;
  17. } else if (error) {
  18. this.error = error;
  19. this.record = undefined;
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement