Loading

Salesforce CPQ Advanced Calculator supported formulas

Publiceringsdatum: Apr 21, 2025
Beskrivning
Formula Fields and Price Rule formulas may reference any fields or relationships, subject to the following restrictions.
 
Note: If you attempt to calculate a Quote that references invalid formulas/functions or incorrect lookup relationships, you will likely encounter the error 'Cannot read property 'split' of null'. To resolve the error, ensure your formulas in Price Rules/QCP comply with the guidelines below.
Lösning

Non-supported formulas and functions

The following functions and variables are not supported. Formula fields that reference them are not evaluated and Price Rules formulas that reference them cause calculations to fail.

  1. DISTANCE()
  2. GEOLOCATION()
  3. GETSESSIONID()
  4. ADDMONTH()
  5. Global variables, i.e. any variable beginning with $
  6. ISCHANGED


Reference standard fields on standard objects (available as of CPQ v214 Summer '18)

Be careful when referencing standard fields on standard objects, particularly non-Text types, in custom formula fields used in the CPQ calculcation sequence. Formulas referencing standard fields can cause formulas to fail during calculation. To resolve the issue, create a formula field on the object in question that references the standard field, and reference that field in your formula instead. For example, if a reference to Account.Industry is causing a calculation to fail, create a formula on Account that contains the value of Account.Industry and reference in the custom formula field. The following standard fields (among others) are universal to all Salesforce objects, and are therefore safe to use in any formula by way of the previously mentioned approach. 

1. CreatedDate
2. LastModifiedDate
3. Name
4. OwnerId
5. CreatedById
6. CurrencyIsoCode


Reference lookup objects

Formulas should not directly reference lookup relationships that do not originate on either the Quote, Quote Line, or Quote Line Group objects. This is best illustrated with a series of examples.

 

1. The following Quote Line formulas are ACCEPTABLE:
1. IF(SBQQ__Existing__c, SBQQ__PriorQuantity__c * SBQQ__ListPrice__c, SBQQ__Quantity__c * SBQQ__ListPrice__c). This formula does not reference any lookup relationships at all.
2. IF(SBQQ__Quote__r.SBQQ__StartDate__c < TODAY(), 'PAST', 'FUTURE'). This formula references the Quote object.
3. Product__r.Name & ' ' & Product__r.ProductCode. This formula references the Product__r relationship, which originates on the Quote Line object.
4. SBQQ__Quote__r.Account__r.Name. The Account__r relationship originates on the Quote object, and is therefore acceptable.
2. The following Quote Line formulas are NOT ACCEPTABLE:
1. IF(Product__r.SBQQ__DiscountSchedule__c.IsCrossOrders__c, 'Hooray', 'Boo'). The DiscountSchedule__r relationship originates on the Product object. To resolve this issue, create a formula field on the Product object that references DiscountSchedule__r.IsCrossOrders__c, and reference that field instead. For example, IF(Product__r.IsDiscountCrossOrders__c, 'Hooray', 'Boo').
2. SBQQ__Quote__r.Opportunity2__r.Contract__r.Description. The Contract__r relationship originates on the Opportunity object. To resolve this issue, create a formula field on the Opportunity object that references Contract__r.Description and reference that field instead. For example, SBQQ___Quote__r.Opportunity2__r.ContractDescription__c.


NOTE: The 3 previously mentioned restrictions apply to all fields that satisfy both of the following criteria:

1. The field exists on the Quote, Quote Line, or Quote Line Group object.
2. ONE OR MORE of the following are true:
  • The field is displayed in the Line Editor.
  • The field is referenced by a Quote Calculator Plugin.
  • A Price Condition references the field in its Tested Formula or Filter Formula, or uses it as a Tested Field.
  • The field is used as the Tested Field of a Lookup Query.
  • A Price Action uses the field as its Source Field, or references it in its Source Formula.
  • The field is used as the custom quantity field for a Block Price or Discount Schedule.
  • The field is used as the constraint field of a Discount Schedule.
  • A Summary Variable uses the field as its Aggregate Field, Filter Field, or Constraint Field.
  • The field is referenced by another field that satisfies one or more of the above criteria within this bulleted list.
Knowledge-artikelnummer

000383094

 
Laddar
Salesforce Help | Article