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.

Quote Calculator Plugin Methods

The Quote Calculator Plugin can reference these seven methods. You can export any, all, or none of them to achieve your desired behavior.
Available in: Salesforce CPQ Winter ’16 and later

onInit

Param Type Description
{QuoteLineModel[]} quoteLineModels An array containing Javascript representations of all lines in a quote.

The calculator calls this method before formula fields are evaluated. Returns {promise}.

onBeforeCalculate

Param Type Description
{QuoteModel} quoteModel Javascript representation of the quote you’re evaluating
(QuoteLineModel[]} quoteLineModels An array containing Javascript representations of all lines in the quote

The calculator calls this method before calculation begins, but after formula fields have been evaluated. Returns {promise}.

onBeforePriceRules

Param Type Description
{QuoteModel} quoteModel Javascript representation of the quote you’re evaluating
(QuoteLineModel[]} quoteLineModels An array containing Javascript representations of all lines in the quote

The calculator calls this method before it evaluates price rules. Returns {promise}.

onAfterPriceRules

Param Type Description
{QuoteModel} quoteModel Javascript representation of the quote you’re evaluating
(QuoteLineModel[]} quoteLineModels An array containing Javascript representations of all lines in the quote

The calculator calls this method after it evaluates price rules. Returns {promise}.

onAfterCalculate

Param Type Description
{QuoteModel} quoteModel Javascript representation of the quote you’re evaluating
(QuoteLineModel[]} quoteLineModels An array containing Javascript representations of all lines in the quote

The calculator calls this method after it completes a calculation, but before re-evaluating formula fields. Returns {promise}

isFieldVisible

This method can’t be used to alter data.

Note

Param Type Description
{FieldName} String Name of the field that will be hidden or made visible
(QuoteLineModelRecord} quoteLineModelRecord Javascript representation of the SObject record of line you’re evaluating

The calculator calls this method after it completes a calculation. Returns {Boolean}

isFieldEditable

This method can’t be used to alter data.

Note

Param Type Description
{FieldName} String Name of the field that will be made read-only or editable
(QuoteLineModelRecord} quoteLineModelRecord Javascript representation of the SObject record of line you’re evaluating

The calculator calls this method after it completes a calculation. Returns {Boolean}