How Are the Publisher and Quick Action APIs Different?
Implementation
Salesforce Classic Publisher JavaScript APIs
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({...})Lightning Quick Action JavaScript APIs
To implement, use the component lightning:quickActionAPI in your custom Aura component. For example:
1<aura:component
2 implements="flexipage:availableForRecordHome"
3 description="My Aura 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
Salesforce Classic Publisher JavaScript APIs
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.
Lightning Quick Action JavaScript APIs
Works with any quick actions on a record page in any Lightning Experience app. Supports apps with standard navigation and console navigation.
Available Methods
Salesforce Classic Publisher JavaScript APIs
Provides the following methods:
- publisher.customActionMessage
- publisher.invokeAction
- refresh
- publisher.selectAction
- publisher.setActionInputValues
Lightning Quick Action JavaScript APIs
Provides the following methods:
Lightning Experience and Salesforce Classic Support
Salesforce Classic Publisher JavaScript APIs
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.
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.
Lightning Quick Action JavaScript APIs
Works only in Lightning Experience. Before implementing, review the Quick Action API Considerations.