How-to Guide
Nue Platform
Quote-to-Order Conversion Plugin
7 min
users like our instant pricing calculations for usage product lines in the quote line editor, especially when dealing with complex price tiering, multiple price and discount tags, and discretionary discounts however, when the quantity is set to 0, many calculations, including discretionary discounts, are effectively zeroed out in certain scenarios, users would like to see that the quantity field in the line editor represent an estimated quantity, enabling price estimations for usage products when the quote is converted into an order, the usage product lines will have their total price, tax amount, and total amount automatically set to zero, ensuring they do not impact the actual booking this approach provides flexibility for estimation while maintaining accuracy in booking to support this scenario, nue provides an apex plugin quotetoorderconversionplugin that allows salesforce admins or implementation services to zero out the quantity, total price, tax, list price, and total amount when the quote is finalized into an order this process can be illustrated in the diagram below plugin interface nue provides the following plugin interface in custompluginmanager global class global interface quotetoorderconversionplugin { //return the list of quote line items of the quote that will have the quantity, total price, tax, and total amount set to 0, while other fields remain intact list\<id> getquotelineswithquantitysettozero(list\<id> quoteidlist); } all quote ids in the same quote to order conversion transaction will be available in the plugin method getquotelineswithquantitysettozero() processing logic the following processing will occur when there exists a plugin implementation for the filtered quote line items, the following fields will be set to 0 while being converted to order products other fields remain the same, especially net sales price, discount %, and system discount % discount amount list total quantity subtotal system discount amount tax total amount total price on the converted order, the following price summary fields will be recalculated with the corresponding quote pricing field values minus the summation of the line items that are zero’ed out discount % discount amount list total subtotal system discount % system discount amount tax total amount total price if the quote is an initial quote, the summary lines that contain ramp lines satisfying the filtering condition will also have the following field values recalculated with the corresponding quote pricing field values minus the summation of the direct children line items that are zero’ed out discount % discount amount list total subtotal system discount % system discount amount tax total amount total price if the quote is a change quote, the summary lines that contain change lines satisfying the filtering condition will also have the following field values recalculated with the corresponding quote pricing field values minus the summation of the direct children line items including summary lines and line items that are zero’ed out discount % discount amount list total subtotal system discount % system discount amount tax total amount total price if the quote is split into one or more buckets, when the buckets are finalized into orders, the above processing also takes effect it is up to the plugin implementation to pass a superset of the line items that need to have the quantity and related fields set to 0 however, when we process these lines, we’ll do the following process all lines with type ' lineitem ` and ` rampitem ` that satisfy the filtering condition; process all their parent summaryitem lines to recalculate the totals the user can follow the steps below to implement an quote to order conversion pluginto create a invoice preview filter using salesforce apex code step 1 implement invoice preview plugin step 2 register the plugin step 3 test the invoice preview step 1 implement quote to order conversion plugin create an apex class that implements the following interface ruby custompluginmanager quotetoorderconversionplugin note the apex class must be declared as ‘ global ’ since the interface is a global interface //the following is an example of the interface implementation, where the user wants to zero out the quantities of the usage line items global with sharing class zerooutquantityplugin implements custompluginmanager quotetoorderconversionplugin { global list\<id> getquotelineswithquantitysettozero(list\<id> quoteidlist) { list\<id> quotelineitemids = new list\<id>(); for (quotelineitem item \[ select id from quotelineitem where product2 ruby pricemodel c = 'usage' and quoteid in \ quoteidlist ]) { quotelineitemids add(item id); } system debug('quotelineitemids = ' + quotelineitemids); return quotelineitemids; } } step 2 register the plugin login to your salesforce org and navigate to setup search for ‘custom setting’ and navigate to the custom settings list page click on the ‘manage’ link on ‘nue system setting’ search for 'quotetoorderconversionplugin’ and click ‘edit’ if there is no entry found, create a new record with the following information name quotetoorderconversionplugin category custom plugin description plugin to zero out usage quantity when a quote is finalized into an order label quote to order conversion plugin in the value field, enter your apex class name, e g , zerooutquantityplugin, and click 'save' step 3 test the plugin now the plugin is ready to be tested the plugin will take effect when a quote is automatically finalized into an order upon the opportunity reaching a certain stage, or when a quote is manually finalized into an order
🤔
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.