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
0 votes
0 answers
24 views

Lightning Web Security (LWS) and Message Service (LMS)

I'm trying to get my code to support Lightning Web Security, but when I enable it, my pages with LMS start failing. I commented out everything to do with the message service and the page loaded fine. ...
  • 765
0 votes
0 answers
51 views

Problem sending a message to a Lightning web component from a Visualforce page

I have a VisualForce page(set as an OpenCTI adapter) that contains a Lightning web component Both the page and the Lightning web component subscribe to the same message channel. My requirement is that ...
  • 11
1 vote
1 answer
93 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 ...
  • 11
0 votes
0 answers
86 views

LMS Pub-Sub between Flow Aura Container and LWC component fails

I'm confronting the issue that the last subscription from LWC fails without any error. Since I needed to pass a complicated object between screen components on different steps in Flow (which are not ...
0 votes
1 answer
188 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. ...
0 votes
0 answers
127 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 ...
0 votes
1 answer
135 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 ...
1 vote
1 answer
478 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="...
2 votes
1 answer
79 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", ...
  • 1,899
1 vote
1 answer
108 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 ...
0 votes
0 answers
56 views

LMS retrieval/update lags 1 click behind

It seems that the component relying on the URL update doesn't get the correct mediaId from the URL. The first click gets the Something went wrong.... <template>, then each following click is 1 ...
0 votes
0 answers
22 views

Is there a way to know the Publisher details in Lightning Message Channel?

I have 5 lightning web componet on my flex page. One of the components like to maintain the list of components and run some business logic on one of the events? I know I can send the component name or ...
  • 1
0 votes
1 answer
192 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.
  • 352
0 votes
1 answer
317 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 ...
  • 11
1 vote
0 answers
211 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 ...
  • 41
0 votes
1 answer
601 views

Lightning Message Service is not working

I have implemented the LMS(Lightning Message Service) concept in my project because I have to pass some parameter values from LWC component to Aura component. the problem is my LWC component is not ...
  • 115
2 votes
1 answer
498 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 ...
  • 131k
0 votes
1 answer
428 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 ...
1 vote
1 answer
159 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 ...
  • 41
8 votes
1 answer
283 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 ...
  • 352
5 votes
1 answer
290 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 ...
  • 131k
1 vote
1 answer
258 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 ...
1 vote
1 answer
180 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 ...
6 votes
2 answers
656 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? ...
0 votes
1 answer
574 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 ...
  • 5,574
0 votes
2 answers
214 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 ...
2 votes
1 answer
2k 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 ...
0 votes
1 answer
178 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 ...
0 votes
1 answer
635 views

Publish/Subscribe Message Service VS Parent to Child LWC

Quick theoritical question. I've read about the lightning message service communication between Lightning Web Components and it was specified that this type of communication is between unrelated ...
3 votes
1 answer
3k 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:...
  • 33
6 votes
1 answer
2k 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 ...
  • 645
0 votes
0 answers
43 views

Events between components not on the same system

As the question goes, what can I use to communicate between 2 LWC components which are accessed by different users? I am trying to build a Sprint planning poker app in LWC, where the vote submitted by ...
1 vote
1 answer
671 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 ...
2 votes
0 answers
471 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 ...
1 vote
1 answer
62 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....
1 vote
1 answer
391 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 ...
0 votes
0 answers
12 views

Why define lightningMessageFields in Lightning Message Service? [duplicate]

I am wondering something. In the XML file of a lightning message channel I can specify lightningMessageFields or I can omit this. Either way messages on the channel function correctly whatever you put ...
  • 79
2 votes
1 answer
275 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 ...
  • 113
0 votes
0 answers
785 views

LMS throwing :sorry to interrupt error[invalid message context]

I am trying to publish a message form lWC , but getting error as below: lightning/messageService: invalid message context] i have created the message channel file added it in the package.xml and ...
0 votes
0 answers
118 views

Sending message from AURA to LWC

I have a requirement to send messages from Aura component to an LWC component. The component exist on the The Aura Component contain an LWC inside it,, i need if the tab of Aura is open the i need to ...
3 votes
1 answer
479 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 ...
  • 314
0 votes
0 answers
2k views

LWC LMS: Invalid message context error

I ask this question because I did not find any similar. My error is "invalid message context". I will explain it graphically. From tab 1, I create a record, with a navigation mixin, I am ...
  • 58
2 votes
0 answers
155 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 ...
1 vote
1 answer
896 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 ...
  • 7,718
3 votes
0 answers
250 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" ...
  • 31
1 vote
1 answer
407 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?
  • 533
3 votes
2 answers
645 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='/...
0 votes
0 answers
384 views

Receiving error "Cannot convert a Symbol value to a string" at @wire (MessageContext)

I am getting an error while publishing message from one web Component: [error = TypeError: Cannot convert a Symbol value to a string at], it occurs while receiving MessageContext using @wire(...
2 votes
1 answer
358 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.
  • 13.4k
1 vote
1 answer
562 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 ...
  • 1,899