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.
Canvas App Events Considerations
Keep these considerations in mind when implementing canvas app
events:
- We recommend that you use a namespace when naming events, but it’s not required.
- The event namespace is different than the organization namespace in Salesforce. However, if you use namespaces, we recommend that you make the event namespace the same as the organization namespace.
- The namespace must be a string with no periods in it. For example, my.name.space.statusChanged is invalid. An example of a valid event name with a namespace is mynamespace.statusChanged.
- These names are reserved and can’t be used as a namespace:
- canvas
- chatter
- force
- publisher
- salesforce
- sfdc
- Events work only between canvas apps on the same page. If you have a canvas app on the Chatter tab, that app can’t subscribe to events published by a canvas app on a Visualforce page.
- You can subscribe to more than one custom event in a subscribe call.
- You can subscribe to only one Streaming API event in a subscribe call.
- You can’t subscribe to a custom event and a Streaming API event with the same subscribe call.
- If you define multiple events with the same name in an array,
only the last event defined is available. In this example, the last
event where the Status is Negotiating is the one that’s used.
1Sfdc.canvas.client.subscribe(sr.client, [ 2{ 3 name :"mynamespace.statusChanged", 4 payload : {status : 'Closed'} 5}, 6{ 7 name:"mynamespace.statusChanged", 8 payload : {status : 'Negotiating'} 9]);This is also true for Streaming API events.