Loading
Important Advisory: iOS Update Impacting CG Mobile ApplicationRead More
Penny Perfect Pricing
How Penny Perfect Pricing Calculates Prices

How Penny Perfect Pricing Calculates Prices

Follow the step-by-step sequence the pricing calculator runs to turn an order into ERP-consistent net prices.

Required Editions

Available in: Lightning Experience
Available in: Enterprise and Unlimited Editions in Manufacturing Cloud, Automotive Cloud, and Consumer Goods Cloud, with required add-ons.

Penny Perfect Pricing uses a structured execution sequence that mirrors your backend ERP system's pricing behavior. The pricing calculator retrieves the pricing conditions for every order line item and evaluates them in a configurable, step-by-step sequence.

Pricing Calculation Workflow

When a rep or an API submits an order for pricing, Penny Perfect Pricing runs this sequence.

  1. Order input. The calculator receives an order with header details (such as customer account, sales organization, and order type) and line items (products, quantities, and units of measure).
  2. Schema determination. Based on the order's pricing type and the Internal Organization Unit, the calculator identifies the matching calculation schema and loads it.
  3. Context hydration. The calculator populates the pricing context (AdvOrderSalesTxnContext__stdctx) with order header attributes, line-item values, account hierarchy details, and product dimensions.
  4. Schema traversal. The calculator traverses the calculation schema step by step, evaluating each step's linked Pricing Specification and Search Strategy.
  5. Merge key generation. The calculator generates consolidated lookup keys (merge keys) from the Key Type definitions mapped to each active Search Strategy Step.
  6. Bulk lookup. The calculator runs a single bulk query against the consolidated pricing table (External Pricing Key Value Consolidated View) to retrieve all matching conditions.
  7. Calculation. The calculator evaluates and applies the retrieved conditions in sequence. You can configure the calculator to:
    • Hierarchical search: Evaluate lookups from most specific (customer- or product-specific) to base-price fallbacks, across both account hierarchies and product hierarchies.
    • Scale and tier determination: Calculate volume discounts using graduated intervals or threshold-based tiers.
    • Group conditions: Sum quantities across eligible line items to evaluate order-level threshold discounts.
    • Exclusion logic: Stop further search steps when an exclusive condition matches.
    • Compound taxation: Compute primary and secondary taxes on base prices and cumulative subtotals.
    • Unit-of-measure conversions: Convert line-item quantities to match condition rates defined in specific units of measure.
  8. Result assembly. The calculator assembles the priced order with line-level net prices and writes the pricing waterfall log, detailing evaluated, applied, and excluded conditions.
  9. Return. The calculator returns the calculated order and the pricing details to the user or the requesting API.

Calculation Flow Example

See how the Pricing Calculator turns a base price into a net order-item price, one step at a time.

This example shows how the Pricing Calculator prices a single line item as it moves through the calculation schema. Your schema and conditions determine the actual steps; the values here are illustrative.

  • Step 10 — Base Price: $100.00
  • Step 20 — Customer-Specific Discount: -10% → $90.00
  • Step 30 — Volume Scale Discount: -$5.00 → $85.00
  • Step 40 — Sales Tax: +5% → $89.25
  • Net Order Item Price: $89.25
 
Loading
Salesforce Help | Article