Newer Version Available

This content describes an older version of this product. View Latest

How Are the Publisher and Quick Action APIs Different?

The user interface in your org can dictate which development tools you can use to interact with actions. In Salesforce Classic, you use the Salesforce Classic Publisher JavaScript APIs with Visualforce components to interact with actions. In Lightning Experience, you use the lightning:quickActionAPI component to call the Lightning Quick Action JavaScript APIs to interact with actions.
Different How? Salesforce Classic Publisher JavaScript APIs Lightning Quick Action JavaScript APIs
Implementation

To implement, load the publisher script in your Visualforce page or component. For example:

1<script 
2  type='text/javascript' 
3  src='/canvas/sdk/js/43.0/publisher.js'/>

Then you can reference the Publisher APIs through the Sfdc.canvas.publisher object. For example:

1Sfdc.canvas.publisher.selectAction({...})

To implement, use the component lightning:quickActionAPI in your custom Lightning component. For example:

1<aura:component 
2  implements="flexipage:availableForRecordHome" 
3  description="My lightning component">
4      <lightning:quickActionAPI 
5        aura:id="quickActionAPI" />
6</aura:component>

Then you can reference the Quick Action APIs in your controller code.

Supported Actions, Apps, and Pages Works with any quick action on a record page in Salesforce Classic apps for objects that are feed-enabled. Supports apps with standard navigation and console navigation. Works with any quick actions on a record page in any Lightning Experience app. Supports apps with standard navigation and console navigation.
Available Methods

Provides the following methods:

Provides the following methods:

Lightning Experience and Salesforce Classic Support

Works in Salesforce Classic and Lightning Experience.

Starting with API version 43.0 of the Salesforce Classic JavaScript Publisher API, the methods used in Visualforce components and pages work in Lightning Experience. Just point to the latest version of the Publisher API script in your Visualforce pages.

Tip

1<script 
2  src="/canvas/sdk/js/43.0/publisher.js" 
3  type="text/javascript">
4</script>

The portalPostFields input value is not supported in Lightning Experience.

Note

Works only in Lightning Experience.

Before implementing, review the Quick Action API Considerations.

Tip