Loading

Unit Price Scale in Salesforce CPQ

Publiceringsdatum: Apr 30, 2025
Beskrivning
The number of decimal places (MAX 9) for the fields in the QLE or on Quote Documents will respect the package level setting even though the database will save all the decimal values. In order to understand how decimal precision is included in the native calculation sequence, the information below is a simplified version of the calculation sequence:
Lösning

Salesforce CPQ offers the option to enhance the decimal precision used when calculating Quote Lines in the general package settings. This setting may be updated by following this path:

Setup | Installed Packages | Salesforce CPQ | Configure | Pricing and Calculation | Unit Price Scale


You can enable additional decimal precision for certain fields by changing the Package setting Unit Price Scale to have a specific number of decimal points, it will affect the number of decimal points observed in the other fields in the Quote Line Editor (QLE).  In Salesforce CPQ, List Unit Price, Regular Unit Price, Net Unit Price, and Additional Discount can be added to Line Editor field set where it can be visually confirmed that they do respect the number of decimal points defined in Unit Price Scale. In order to have this precision reflected across Salesforce, see Enable 'More Decimals on Price'.

The number of decimal places for the fields in the QLE or on Quote Documents will respect the package level setting even though the database will save all the decimal values. In order to understand how decimal precision is included in the native calculation sequence here is a simplified version of the calculation sequence:

 

List Unit Price (or Special Price IF Special Price Type is not blank)

  • Volume Discount Schedule
  • Term Discount Schedule
  • Prorate Multiplier
  • Block Pricing

Regular Unit Price

  • Additional Discount (can be applied as a percent or an amount)
  • Custom Unit Price
  • Partner Discount

Partner Price

  • Distributor Discount

Net Unit Price

Note:
Bold Fields above respect the CPQ package settings for Unit Price Scale.


Unit Price Fields

Each of the Unit Price fields in the above section will show additional decimal precision in the Line Editor as well as SBQQ__AdditionalDiscount__c. These values will be stored to the database as well as when the Quote is saved.

Modifying the value of Unit Price Scale in the Pricing and Calculation Package Settings will not change the field definitions for the fields effected by this setting outside of the Edit Lines visual force page. For example, SBQQ__CustomerPrice__c has a field definition with decimal precision of 2 (12,2). The value presented to the user on the Quote Line record will always abide by this field definition. However, the value stored to the database will be aligned with whatever is defined for the unit price scale in the package settings. 
 

Note, in Classic any edit and save to a record on its detail page will force all the fields on the page layouts to have their values truncated to abide by their field definition. If a field holding additional precision on is on the page layout when an edit + save occurs it will be truncated to the field’s defined decimal precision. If it is not on the layout, it will not be truncated when the record is edited and saved on the detail page. Lightning Experience will retain the number of decimal places when an edit + save occurs.
 

Total Price Fields

CPQ Totals fields are managed Currency Formula Fields with (16,2) decimal precision. Currency Formulas display based on decimal precision for the Currency Decimal Precision defined in Manage Currencies settings (Setup > Manage Currencies). However, the formula logic will evaluate and store based on the Field level decimal precision, rounded up. Output Unit/Totals on Opportunity Product or Order Product will store the entire values with increased precision. If increased precision is required at the Quote level, a custom Currency Field with enhanced precision can be created, referenced, and rolled up.
 

System Discounts 

When using Discount Schedules (Term or Volume) an admin is allowed to define decimal precision on the Discount Schedule record. The precision defined on the Discount Schedule record will determine the precision to which the Discount Amount is calculated from the percentage defined on the associated Discount Tier. If a Discount Tier uses an amount discount instead of a % discount, the value defined in the SBQQ__DiscountAmount__c will be used. 

Example:
Unit Price Scale = 2
List Price = $5.32
Discount Tier = 7%
Discount Schedule's Price Scale = 4


All Discounts are applied between unit prices as an amount. The amount is calculated by multiplying the previous unit price by the discount percentage and the precision of the discount amount is calculated to the Discount Schedule's Price Scale. 

Note: In between List and Regular Unit Prices, note that the Discounts are calculated after the Prorate Multiplier has been applied to the List Unit Price.

5.32 * .07 = $0.3724


The value is then subtracted from the previous unit price:

5.32 - .3724 = 4.9476 


The unit price is then rounded to meet the unit price scale defined in the org:

$4.95

 

Block Prices

Block Prices are currently restricted to two decimals, as the “Edit All” VisualForce page for editing Block Prices will truncate any additional precision to the 2 decimals allotted in the SBQQ__Price__c field for the Block Price object. 

 

User-entered Discount Fields:

Within the QLE SBQQ__AdditionalDiscount__c will hold enhanced precision. If SBQQ__Discount__c or SBQQ__DiscountAmount__c are added to the QLE they will not respect additional precision. But, they will capture the enhanced precision in their field values within the database if SBQQ__AdditionalDiscount__c is used to calculate their value. 

 

Within the Line Editor SBQQ__PartnerDiscount__c and SBQQ__DistributorDiscount__c show as percent fields (3,2) in alignment with their field definitions. They do not display additional precision when increased decimal precision is defined in the package settings, but they are used in the calculation sequence in such a way that they will support enhanced decimal precision. 

 

When used as a percent, SBQQ__AdditionalDiscount__c will first calculate a discount amount to the decimal precision defined in the managed package settings. Then, this amount will be subtracted from Regular Unit Price to achieve the Customer Unit Price. If an Additional Discount is applied as an amount, the user entered value will be rounded to the precision defined in the unit price scale and subtracted from Regular Unit Price to achieve the Customer Unit Price. 

 

Within the Line Editor SBQQ__PartnerDiscount__c and SBQQ__DistributorDiscount__c show as percent fields (3,2) in alignment with their field definitions. They do not display additional precision when increased decimal precision is defined in the package settings, but they are used in the calculation sequence in such a way that they will support enhanced decimal precision. 

 

Example of how a Discount is calculated:

SBQQ__Discount__c (Additional Discount applied as a %), SBQQ__PartnerDiscount__c and SBQQ__DistributorDiscount__c are all applied in the same manner at their respective step in the calculation sequence. 

 

Given SBQQ__RegularPrice__c of 10.9473, Unit Price Scale of 4 and SBQQ__Discount__c of 5%

First, calculate the discount amount by multiplying the previous unit price by the discount percent and rounding the value based on unit price scale:

$10.9473 * 0.05 = $0.547365

$0.547365 rounds to $0.5474

Then this value will be subtracted from the previous unit price to achieve the next unit price in the calculation sequence:

$10.9473 - $0.5474 = $10.3999 

Thus SBQQ__CustomerPrice__c =  $10.3999 

 

Maintaining Decimal Precision throughout Orders, Amendments and Renewals

Enhanced decimal precision should be captured through the order, amendment and renewal processes. The objective is to retain the unit price scale defined in the managed package setting consistently through the data flow.: 

 

Order Product:

  1. SBQQ__QuotedListPrice__c 
  2. TotalPrice
  3. UnitPrice


Asset Fields:

  1. SBQQ__ListPrice__c 
  2. SBQQ__RegularPrice__c 
  3. SBQQ__Discount__c 
  4. SBQQ__AdditionalDiscountAmount__c 


Subscription Fields:

  1. SBQQ__ListPrice__c 
  2. SBQQ__SpecialPrice__c 
  3. SBQQ__RegularPrice__c 
  4. SBQQ__CustomerPrice__c 
  5. SBQQ__NetPrice__c 
  6. SBQQ__Discount__c 
  7. SBQQ__AdditionalDiscountAmount__c 
Knowledge-artikelnummer

000382046

 
Laddar
Salesforce Help | Article