Skip to main content

Questions tagged [lightning-message-service]

Questions related to the Lightning message service when communicating across DOM between Visualforce pages, Aura components, and Lightning web components, including components in a pop-out utility bar.

Filter by
Sorted by
Tagged with
8 votes
1 answer
611 views

Can I use wire adapter in classes that do not inherit from LightningElement?

Is it possible to use @wire in classes that do not inherit from LightningElement? Example: export default class A { @wire messageContext; } What I want to achieve: I want to create a ...
Rechu's user avatar
  • 452
7 votes
1 answer
1k views

Refresh LWC when related list is updated or related file is deleted

I have a custom LWC on a record detail page. This LWC displays files related to the record. I cannot use the standard Files related list because I only want to show files of type jpg, jpeg and png. To ...
Nikhil's user avatar
  • 71
6 votes
1 answer
6k views

Communication between two child LWC Components

What is the best way to realize bi-directional communication between two LWC components. Is it better approach to pass values throught parent component or use Lightning message service? Dispatch ...
Grzegorz Połuch's user avatar
6 votes
2 answers
1k views

Best practises with Lightning Message Service

As an ISV, I need to establish communication between LWC and Visualforce page. I am planning to leverage LMS and I have 2 questions: Which are the best practices regarding Lightning Message Channels? ...
Gabriel Serrano Salas's user avatar
5 votes
1 answer
347 views

Is a headless daemon LWC a good pattern?

I want to write an LWC that listens for a small set of LMS messages, performs database operations sometimes and sometimes forwards new LMS messages for the benefit of another LWC that may or may not ...
Keith C's user avatar
  • 136k
4 votes
1 answer
841 views

How to use LMS & EMP-API in the same LWC component

As both empApi and LMS require the import of the subscribe and unsubscribe methods. How can you use both within the same component? import { subscribe, unsubscribe} from 'lightning/empApi'; import { ...
J Dubbs's user avatar
  • 392
4 votes
1 answer
2k views

Send message to aura components from lwc

I have a requirement to send messages from LWC component to an Aura component. The component exist on the page independently, i.e LWC is not embedded in an aura component. The components are in a ...
george thomas's user avatar
4 votes
0 answers
403 views

Trying to publish Lightning Message Channel from Visualforce page and getting error `Sfdc is not defined`

I am trying to publish a message from a visualforce page into a lightning component and my visualforce page is not able to publish. My Visualforce code : <apex:page applyBodyTag="false" ...
nyuv's user avatar
  • 41
3 votes
1 answer
2k views

What's the benefit of using Custom Event over Lightning Messaging Service? [closed]

Custom Events are used to pass the data from child component to parent component but we can achieve the same functionality with Lightning Messaging Service(LMS). What is the benefit of using custom ...
PARAG TALUKA's user avatar
3 votes
2 answers
994 views

Not able to use LMS in VF page iframe in Aura Component

I want to use LMS to publish data from the VF page and receive it in Aura Component. I have an Aura Component and am trying to iframe a Visualforce page in it. <aura:component> <iframe src='/...
Krishna Teja Karnam's user avatar
3 votes
1 answer
1k views

Should Lightning Message Service (LMS) work from a Lightning Web Component Action?

I've just moved some logic from one LWC into a "headless" @api invoke() LWC that is configured as an Action that appears as a button in the standard "Highlights Panel" LWC. The ...
Keith C's user avatar
  • 136k
3 votes
1 answer
9k views

LightningMessageChannel error

I'm trying to do some trainning for LWC using LMS, but when I push my source I get below error org.auraframework.throwable.AuraRuntimeException: Unable to retrieve metadata for descriptor: markup://c:...
yozhang's user avatar
  • 43
3 votes
1 answer
813 views

Lightning Messaging Service: sforce.one not defined

I am using Lightning message service to pass message from VF page to LWC. VF page is in iframe and I am using this method to publish message sforce.one.publish(CHANNEL, message); However I am getting ...
Amit's user avatar
  • 354
3 votes
0 answers
310 views

Including Lightning Message Service in Managed Package?

I am attempting to make use of the Lightning Message Service to pass events between components when various actions occur (e.g. Sending an email, or authenticating the app. The Salesforce docs suggest ...
Anthony Kelly's user avatar
2 votes
1 answer
2k views

Communicate across tabs in LWC using Message service

I am trying to send info across components which are not on the same lightning page. They are on different tabs of the App. When the components are placed on the same page, Lightining message service ...
LoveBomber777's user avatar
2 votes
1 answer
722 views

sforce.one not available in VF page used as CTI adapter

We are using a VF page as a CTI adapter. It does not seem to include sforce.one. I notice on other VF pages this is brought in as part of api.js, but I cannot put my finger on what it is about that VF ...
kamezaburo's user avatar
2 votes
1 answer
601 views

ways to create LightningMessageChannel in Salesforce

I know we can create LightningMessageChannel using package.xml but is there any quick way to create it? Any UI alternative would be far better than package.xml route.
sanket kumar's user avatar
  • 15.4k
2 votes
1 answer
325 views

Better LWC performance: sibling components with separate wires, or a single service component with a wire that sends data via Message Channel

If you have 10 separate components on the same lightning page that are all using the getRecord wire and retrieving approximately the same subset of fields, is there a performance penalty in comparison ...
Trevor Gill's user avatar
2 votes
1 answer
404 views

Is there a LMS payload limit for messages sent?

I am looking to understand if there a payload size limit for LMS. ({ handleClick: function(cmp, event, helper) { var payload = { recordId: "some string", ...
S.B.'s user avatar
  • 2,091
2 votes
1 answer
599 views

What is the real use of "lightningMessageFields" while using LightningMessageChannel

I was thinking - while publishing or subscribing to a LightningMessageChannel, the payload has to be in some way match exactly to the names or fields defined in the lightningMessageFields XML ...
vino's user avatar
  • 143
2 votes
1 answer
1k views

Lightning message service(Build a Bear-Tracking App with Lightning Web Components)

When I am making a bear tracking app this problem arises in the last module. Error - afterRender threw an error in 'c:bearMap' [lightning/messageService: The scope property is required. When you call ...
Akash Mishra's user avatar
2 votes
1 answer
69 views

Lightning message channel error

This is my meccage channel code. <?xml version="1.0" encoding="UTF-8"?> <LightningMessageChannel xmlns="http://soap.sforce.com/2006/04/metadata"> <...
Neha Palekar's user avatar
2 votes
0 answers
815 views

Odd Error Returned When Using Lightning Message Service in LWC - WindowMessengerNoConnectionError

This is my first time using Lightning Message Service. I set it up following the directions on this standard documentation page. After setting this up I am able to communicate between two lightning ...
Tim Wilson's user avatar
2 votes
0 answers
925 views

Lightning Message service error in visualforce page - Cannot read property 'subscribe' of undefined

Was anybody able to work with sforce.one.subscribe for subscribing to lightning message service in visualforce? I keep getting below error: Even after including sforce and ajax js files, sforce.one ...
salesforce-sas's user avatar
1 vote
1 answer
2k views

MessageChannel not working

I am testing out Message Channel feature. I have a very simple code which is not working: Component 1: <template> <lightning-card title="Publish Experiment" icon-name="...
DevelBase2's user avatar
1 vote
1 answer
961 views

LMS send multiple message to one component

I need to send multiple message into one component via Lightning message system using one message channel.Is it possible or i must use multiple message channel? I tried to google, but didn't found ...
Terdivi's user avatar
  • 51
1 vote
1 answer
980 views

Visualforce to Visualforce Lightning Component Communication - postMessage not received

I have two visualforce page lightning components on a lightning page. I am unable to get them to communicate, there are no logs to the console and no errors to report. The posted messages are not ...
S.B.'s user avatar
  • 2,091
1 vote
2 answers
124 views

Incorrect data displayed in lightning datatable

I have a LWC which takes value from 3 input fields and passes the value to a separate component with lightning datatable via LMS. I am able to pass the data for the first time but when I try to repeat ...
code234's user avatar
  • 308
1 vote
1 answer
886 views

lightning message service not working

I'm using Lightning message service to pass message from LWC to another LWC.Both components are custom components used in community pages. The message is not being sent to the other component. ...
jojo's user avatar
  • 89
1 vote
1 answer
681 views

How to check if LWC component is available for Lightning out

I have several components which have complex logic (Platforn events , Message service) How to check if LWC component/module is available for Lightning out and will work there ? Any help will be ...
Vitalii Dehnerys's user avatar
1 vote
1 answer
486 views

What are the risks of using LMS on an Experience Cloud Site, and is it on the Roadmap to be GA?

Currently I have a few components that use the Lightning Message Service, but I realize that this feature is in beta for Experience Builder sites. As of right now, my components seem to work as ...
Victor Lockwood's user avatar
1 vote
1 answer
818 views

messageChannel folder in VS Code

Should the messageChannel folder be automatically created when I create new sfdx manifest project in VS Code? Or should I create it manually?
Ian Roque's user avatar
  • 563
1 vote
1 answer
306 views

Trying to pull parameters from a LMS Message getting null

I am trying to pull 2 parameters from an LMS message. Currently they are coming in as null at the way I am grabbing them. The publish and subscribe methods work, as I threw console statements to track ...
Tristan Berger's user avatar
1 vote
1 answer
1k views

Lightning Message Service doesn't work between community pages

I have two Lightning Web Components. One is on Community Page #1, the other is on Community Page #2. The first LWC creates a record and then navigates to the second Community page. I need to send ...
aksnys's user avatar
  • 31
1 vote
1 answer
401 views

Suscribe to LMS published from an LWC in other package namespace

In a Managed Package, am publishing a message using a Lightning Message Channel in a Lightning Web Component. I want to be able to suscribe to this Lightning Message Channel from a Lightning Web ...
Gabriel Serrano Salas's user avatar
1 vote
1 answer
2k views

'sforce is not defined' on Visualforce page when trying to publish with LMS

I'm trying to use the lightning message service on a visualforce page. To simplify things, I'm using the exact code supplied by Salesforce with the one exception I've updated the SAMPLEMC variable to ...
Nick C's user avatar
  • 6,780
1 vote
1 answer
4k views

How to Pass the Data from One LWC to Another LWC during Navigation when using Lightning Messaging Service

Requirement: I want to pass the data from One LWC to another LWC. Both LWC are not on the same page but added in Different Tab. So, when I pass the Data from LWC lmsNavComA, I should expect to see the ...
SFDCDJ's user avatar
  • 1,874
1 vote
0 answers
161 views

Can I use (and how) LMS to stream events from VF page with WS connection to LWC without clicks in the VF

My VF page is directly embedded into the utility bar. As I have a WebSocket used to stream some events, I would like to find a way to use LMS to stream those events to LWC and Aura components. On my ...
Искрен Станиславов's user avatar
1 vote
1 answer
890 views

LWC - Remove a specific record Id from an array Of Objects - Update and re-render updated array's data

I am currently working on an LWC project leveraging the Lightning Messaging System to share information between unrelated components all present on the same lightning page. Here is the main use case: ...
Yann M.'s user avatar
  • 23
1 vote
1 answer
560 views

CORS error in visualforce page (open CTI Softphone integration) that uses Lightning Message service

I have a Visual force page that contains a lightning web component hosted in a Salesforce developer sandbox I have a custom object that will be linked with this Visual force page using the streaming ...
mjk6035's user avatar
  • 11
1 vote
0 answers
551 views

LMS Channel error: Your component must be rendered before you can publish to channel

I have two Aura Components that talk to each other via 2 LMS channels. The flow goes: Once we click on the quick action button on Case Header, it would fire a LMS channel that will be subscribed by ...
Austin Evans's user avatar
1 vote
0 answers
697 views

Can I have multiple instances of the same component using a Lightning Message Service channel?

If I create an lwc app component that uses an LMS message channel, will I run into problems if I have multiple instances of that app in a record page? By problems, I mean all instances of the ...
Drew's user avatar
  • 41
1 vote
1 answer
220 views

Alert on account page for a new note being added

I want to be able to create an alert that is displayed on the account page whenever a new note is added. I've seen the Lightning Message Utility managed component in appexchange (https://appexchange....
Allison Fernandez's user avatar
1 vote
1 answer
1k views

Lightning messaging service communities support for guest users

We are working towards building a community where we have the need to communicate with different parts of the page built with LWC and Aura. Since salesforce launched lightning messaging service we ...
manjit5190's user avatar
  • 8,043
1 vote
1 answer
548 views

Listening to LMS messages from a background utility bar item

I want to do some background processing so I wrote a background utility bar item, and tried listening to LMS messages, but it didn't work. Then I found this: It is a front-end service that works in ...
kamezaburo's user avatar
0 votes
2 answers
514 views

Is lightning message channel package-able

I have used the lightning message channel in LWC and I want to package the same. But lightning message channel is not available in the list. Also, the component available in the managed pacakge ...
Hemant Keni's user avatar
0 votes
2 answers
8k views

How to pass variable value from one LWC component to another without parent child relationship

JS of ProductList Component import { LightningElement, api, track, wire } from "lwc"; import getProducts from '@salesforce/apex/reviewsController.getProducts'; // import productDetails from '...
Muhammad Ahsan Amin's user avatar
0 votes
1 answer
508 views

2-way LMS approach

Requirement: I have a custom subtab (Parent) on my console. It has a web link, upon clicking it opens a new subtab (Child). This Child subtab needs some data from the Parent subtab, so I am ...
Austin Evans's user avatar
0 votes
1 answer
961 views

Is it possible to use LMS in Screen Flows?

I wanted to ask whether there is a possibility to use LMS - Lightning Message Service on Screen Flows in order to enable communication between its components.
Rechu's user avatar
  • 452
0 votes
1 answer
2k views

Use message channel in both direction

I am using message channel to communicate between 2 lwc and both lwc must send and retrieve data. So i am passing value to subscriber and after that to publisher. How can i do it? Do i need to create ...
Wenakey's user avatar