Lightning

Events in Lightning Component and Visualforce page using Lightning Message Service (LMS)

Events in Lightning Component and Visualforce Pages using Lightning Message Channel

Consider a scenario where you are working on multiple components and in which there are Visualforce pages, Lightning Aura Components, Lightning Web Components. We know that we have Lightning Aura Events (Application Event and Component Event) which works in Lightning Aura Component. But what if there is a scenario where you want to send an event across component whether it is between Aura Component or a Web Component or a Visualforce page. Or combination of all three.

Salesforce has introduced Lightning Web Component Message Service (lightning-message-service). It is used to communicate across the DOM between Visualforce pages, Aura components, and Lightning web components, including components in a pop-out utility bar. To communicate across DOM there should be a channel. And salesforce has provided Lightning Message Channel to communicate.

Continue reading “Events in Lightning Component and Visualforce page using Lightning Message Service (LMS)”