Custom Action Plugin
A custom action plugin lets you run code before or after custom actions in Salesforce CPQ. Currently, custom action plugins support only cloning actions.
A custom action plugin can call either the onBeforeCloneLine method or the onAfterCloneLine method so that you can evaluate and modify a quote line before or immediately after the cloning process. These methods accept the following parameters.
| Parameter | Type | Definition |
|---|---|---|
| quote | QuoteModel | A representation of the quote object. |
| clonedLines | Object | Properties:
|
| conn | Object | A jsforce connection. |
To create a custom action plugin, create a custom script record and enter your code in the Code field. Then, go to Salesforce CPQ package settings an open the plugins tab. Enter the name of your custom script in the Custom Action Plugin field and save your changes.
Here’s a basic template for the plugin, without any additional code. You can use onBeforeCloneLine or onAfterCloneLine as needed.