Skip to main content

LMS

Explore practical guides and implementation patterns for this topic.

Posts

Topic LWC
Lightning Web Components

Mastering Salesforce Lightning Message Service (LMS): The Pub-Sub Pattern in LWC

💬 In plain words: Lightning Message Service (LMS) is Salesforce's official "Publish-Subscribe" (Pub-Sub) framework. It acts like a radio station inside a Salesforce page. One component acts as the DJ, broadcasting a message, and any other component on the page can tune into that station to hear it. This allows unrelated components (even across LWC, Aura, and Visualforce) to talk to each other without needing a messy parent-child relationship. Before LMS, if you wanted a component in the left sidebar to update a component in the main page area, developers had to rely on complex URL hacks, window events, or unsupported custom Pub-Sub libraries. Lightning Message Service completely solved this by providing a secure, standardized, and metadata-driven messaging architecture built natively into the Salesforce platform.
Read article
Topic LWC
Lightning Web Components

How to Communicate Between LWC and Visualforce in Salesforce: Complete Integration Guide

In plain words: LWC and Visualforce Integration allows modern Lightning Web Components to trigger actions and exchange data with legacy Visualforce pages (such as custom PDF generators or legacy rendering engines). Rather than popping open disconnected browser tabs, you can embed the Visualforce page in an <iframe> and communicate bi-directionally using window.postMessage or publish/subscribe across the DOM using Lightning Message Service (LMS) . While Lightning Web Components (LWC) is the primary UI framework on Salesforce, enterprise orgs frequently maintain complex Visualforce pages for specialized features like rendering dynamic PDFs ( renderAs="pdf" ) or hosting third-party canvas applications. Connecting these two technologies seamlessly without disrupting the user experience requires secure, cross-window messaging channels.
Read article
Topic LWC
Lightning Web Components

How to Call LWC Methods from Visualforce in Salesforce: Lightning Out & LMS Guide

In plain words: Calling an LWC method from a Visualforce page allows legacy Visualforce layouts to trigger actions inside modern Lightning Web Components. Because Visualforce and LWC run on different runtime engines, communication is handled on the client side using Lightning Out with public @api methods or by publishing events across the platform using Lightning Message Service (LMS) . During digital transformation projects, organizations rarely replace entire Visualforce applications overnight. Instead, developers embed modern Lightning Web Components inside existing Visualforce pages. To make these hybrid pages interactive, your Visualforce JavaScript must be able to invoke functions and pass data directly into the hosted LWC.
Read article