Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
$MessageChannel
A global merge field type to provide access to a message channel defined in your
organization.
Usage
Use this expression in your Visualforce page to access a message channel and use the Lightning Message Service APIs.
Examples
1<apex:page>
2 <script>
3 // Load the MessageChannel token in a variable
4 var SAMPLEMC = "{!$MessageChannel.SampleMessageChannel__c}";
5 function handleClick() {
6 const payload = {
7 recordId: "some string",
8 recordData: {value: "some value"}
9 }
10 sforce.one.publish(SAMPLEMC, payload);
11 }
12 </script>
13 <div>
14 <p>Publish SampleMessageChannel</p>
15 <button onclick="handleClick()">Publish</button>
16 </div>
17</apex:page>