Developer Resources
Order of Operations Explained When a Quote is Saved
11 min
this guide explains the order of execution, dml boundaries, and the synchronous versus asynchronous automation that nue runs upon quote saving, opportunity synchronization, and downstream order creation it also outlines practical completion signals you can use to ensure your own automation runs only after nue has finished each step preventing issues such as orders created without an opportunity and eliminating race conditions this guide also details what happens when a quote is saved in salesforce, including both immediate operations that run synchronously and background jobs that operate asynchronously , and how behavior differs between primary and non primary quotes summary in nue, all pricing calculations are performed directly in the line editor using the embedded pricing engine when the quote is saved, additional server side logic runs, including synchronizing line items to the opportunity (for primary quotes) and generating the associated order metrics extension record when a quote is saved on the line editor or via apex / api, the following is the summary of the order of operations immediate (real time) actions quote saves with smart defaults (subscription term, tax code) if you mark the quote as primary , the system ensures it’s the only one a metrics record ( ruby ordermetricsextension c ) is created to track acv and other values background processing acv, arr, and mrr update automatically if you change the subscription start date, all pricing recalculates custom business rules run seamlessly without slowing down your save primary vs non primary quotes primary quotes automatically sync to the opportunity updating the opportunity reference, creating or updating opportunity products, and keeping forecasts aligned, while non primary quotes save independently without affecting the opportunity key system settings setting name description sync primary quote line items to opportunity products enable/disable primary quote syncing sync primate quote line items for closed opportunity sync primary quotes even if opportunity is closed order acv calculation plugin apex plugin class for acv calc ( ruby custommetricscalculationplugin ) allow quote split into multiple orders enable line bucket splitting synchronous operations what happen immediately when you save a quote when inserting a quote set defaults sets default values of subscription term and tax company code primary quote enforcement if this quote is marked primary, the system automatically unsets any other primary quote on the same opportunity deletes existing opportunity line items create metrics extension record creates a ruby ordermetricsextension c record for calculated values (e g , acv) sync primary quote to opportunity if primary, updates opportunity ruby primaryquote c when updating a quote opportunity change handling if a primary quote is moved to a new opportunity clears old opportunity’s line items removes old opportunity’s primary quote reference field propagation to quote lines if ruby autorenew c or ruby taxcompanycode c changes, all child quote line items update immediately primary quote enforcement ensures only one primary quote exists on an opportunity line bucket updates if quote splitting is enabled, updates ruby linebucket c records asynchronous operations via background jobs primary quote → opportunity sync triggered when a quote becomes primary a primary quote is updated what it does creates/updates opportunitylineitem records for each quote line item (excludes summary lines) syncs 28+ pricing fields such as deltaacv, deltaarr, deltatcv maintains bidirectional links between quote lines and opportunity products skips closed won/lost opportunities (configurable) start date recalculation triggered when ruby subscriptionstartdate c changes on the quote what it does calls external pricing engine shifts all line item date ranges proportionally recalculates pricing updates quote + line items with new values pricing fields sync triggered when quote line items are modified what it does syncs updated pricing metrics back to linked opportunitylineitem records updates deltaacv, deltaarr, discounts, extended prices, etc custom metrics calculation triggered when quote line items change what it does runs customer defined acv logic writes results into ruby ordermetricsextension c ruby acv c allows flexible, plugin driven business rules differences between primary vs non primary quotes primary quote ruby isprimaryquote c = true extra functionality syncs to opportunity (header + all line items) creates/updates opportunitylineitem records sets opportunity ruby primaryquote c ensures no other primary quote exists on the same opportunity deleting the quote removes all synced opportunity products constraint only one primary quote per opportunity non primary quote ruby isprimaryquote c = false behavior no sync to opportunity no opportunity line item generation can save multiple non primary quotes on the same opportunity useful for what ifs and alternatives
Have a question?
Get answers fast with Nue’s intelligent AI, expert support team, and a growing community of users - all here to help you succeed.
To ask a question or participate in discussions, you'll need to authenticate first.