You are here:
Automation Guidelines for Orders and Order Products
Review use cases and guidelines for building automation on orders and order products. (Salesforce Billing Managed Package)
Asynchronous Order and Order Product Jobs
Salesforce Billing runs asynchronous jobs in response to several order and order product actions. Review these asynchronous jobs to ensure they don't interfere with any actions in your custom automation.
| Job Name | Job Type | Job Occurs | Considerations |
|---|---|---|---|
OrderPriceCalculatorService |
Queueable | Checking Ordered on the opportunity or quote. | This process has completed when the order's Price Calculation Status field has a value of Completed, Not Needed, or Failed. |
OrderPriceCalculatorSerivce.populatePriceTiersFuture |
Future | Checking Ordered on the opportunity or quote. | This process runs only for products with a charge type of Usage. |
QueueableContractOrdersClient |
Queueable | Checking Contracted on the order. | none |
QueueableRevenueSchedule |
Queueable | Order activation. | This process runs only for order products related to revenue recognition treatments with a Revenue Schedule Creation Action field set to Order Activation. |
QueueableRevenueTransaction |
Queueable | Order activation. | This process runs only for order products related to revenue recognition treatments with a Revenue Schedule Creation Action field set to Order Activation. |
QueueableTaxCalculator |
Queueable | Order activation and updating tax override fields. | none |
Order Use Cases
Let's review some common use cases for building automation on orders.
| Use Case | Description | Considerations |
|---|---|---|
| Order creation | Create an order from the quote or opportunity when a user or process selects the Ordered field. | Order creation is a synchronous process that occurs in Salesforce CPQ. However,
Salesforce Billing uses the OrderPriceCalculatorService
and OrderPriceCalculatorSerivce.populatePriceTiersFuture triggers to populate Billing
fields on the order. |
| Order activation | Activate an order based on certain criteria when a user or process changes the order's activation status to Activated. Note Activating an order activates all its child order
products. |
We recommend ensuring that CPQ and Billing triggers related to the order object have finished before your automation activates the order. This way, you can ensure that price and tax calculation callouts have finished for pricing on all of the order's order products.
|
| Create a contract from the order | Create a contract from the order by selecting the order's Contracted field. Note Contracting an order contracts all its child order products. |
This process is synchronous by default. However, if you have many order products to contract, you can use Salesforce CPQ's asynchronous contracting process instead. To enable asynchronous contracting, deselect the Contract in Foreground field in Salesforce CPQ's Subscriptions and Renewals package setting. Depending on your org configurations, the asynchronous contracting process can take less time to complete than the synchronous contracting process. |
| Provisioning and fulfillment integrations | Orders and order products are common integration points for customers to turn on services for a customer. In many cases, the fulfillment controls when the invoicing process can begin. | Evaluate your integration patterns and consider when the integrations must run. Most integrations have process considerations for order activation and contract generation. Review your end-to-end process requirements when designing integration points. |
Order Product Use Cases
You can also set automation to occur on order products. Follow the above standards for order product creation, activation, and contracting. You also have several options specific to order products.
| Use Case | Description | Considerations |
|---|---|---|
| Update CPQ or Billing fields on the order product | Update any order product-managed package field. For example, moving the invoice frequency from monthly to quarterly. | When you use automation to update managed package fields on the order product, make sure that your automation doesn't affect any order-level processes. Evaluate and adjust the timing and criteria for triggering automation events if necessary. For example, you can update billing frequency during order creation. To avoid timeouts based on the number of order products created, space out when you trigger billing frequencies. |
| Override date fields | Update the Override Next Billing Date field based on your business's invoicing needs. | Due to the complexity of managing order product dates for billing, we recommend using Apex to build date logic. |
| Legal entity mapping | Map legal entities to order products based on factors such as contacts and addresses. | By default, legal entity mapping occurs upon record creation in the Process Builder, or in a Before Insert trigger for Salesforce Billing Summer '20 and later. We recommend using a Before Insert trigger if you're working with many order products. You can also trigger a Flow upon record creation and run it before saving the record. |

