3

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 sforce.one is undefined error. Can someone please help with this?

1 Answer 1

3

This is a well-documented use case that will not work for LMS. Exposing sforce in an iframed visualforce can lead to Security issues.

From the Docs

Lightning Message Service does not work in Visualforce pages that are included in Lightning Experience via iframes, including wave:dashboard, apex:iframe, and the standard HTML tag. Instead, add Visualforce pages through the Lightning App Builder or as a utility bar item.

1
  • Thanks Mohith! I seem to have missed that part of documentation.
    – Amit
    Oct 31, 2020 at 19:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .