-
-
Save arun12209/4ebf463dcc209524e226e8f47eb2a470 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LightningElement, track } from 'lwc'; | |
import { MessageContext, subscribe } from 'lightning/messageService'; | |
import ACCOUNT_SELECTED from './accountSelected.js'; | |
export default class ReceiverComponent extends LightningElement { | |
selectedRecordId; | |
selectedRecord; | |
connectedCallback() { | |
subscribe(this.messageContext, ACCOUNT_SELECTED, this.handleSelectedAccount, { scope: APPLICATION_SCOPE }); | |
this.messageContext = MessageContext.getInstance(); | |
} | |
handleSelectedAccount(message) { | |
this.selectedRecordId = message.recordId; | |
//fetch selected record with the id | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment