--- title: "Quote to Sales Order Creation" slug: "quote-to-sales-order-creation" description: "Use this extension point to tailor the sales office assignment and other relevant attributes in the Sales Order object to meet your unique business requirements." updated: 2026-06-02T14:05:26Z published: 2026-06-02T14:05:26Z canonical: "docs.zilliant.com/quote-to-sales-order-creation" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.zilliant.com/llms.txt > Use this file to discover all available pages before exploring further. # Quote to Sales Order Creation ## Purpose Allows you to run a script when users [create an ERP sales order](/docs/quote-to-sales-order-creation#create-a-sales-order), to set default values for specified fields on the **New Order** screen. In the script, define custom logic for setting default field values, leveraging data from various lookup tables. By using this extension point, you can tailor the sales office assignment and other relevant attributes in the Sales Order object to meet your unique business requirements. ## Setup Upload the script for **Quote to Sales Order Creation**. For details about uploading and configuring Groovy scripts, read [Upload a Groovy script](/docs/upload-a-groovy-script). ## Binding variables In addition to the [common binding variables](/docs/binding-variables), the following binding variables are available for this extension point. | Variable name | Class | Description | | --- | --- | --- | | order | Order | Represents the order. | | salesItemsTree | SalesItemsTree | Represents the quote. Contains functions you can use to query and modify the quote and its line items. | | userInfo | UserInfo | Represents all users in the system. | For details about the classes listed in this table, including available methods, fields, and method signatures, read the [Zilliant Groovy API reference](/main/docs/groovy-api-reference). ## Sample script Use the following sample Groovy script to upload for this extension point: ```groovy import com.imc.iss.groovy.salesitem.SalesItemsTree; import com.imc.iss.groovy.GroovyCtxUtil import com.imc.iss.groovy.GroovyLogger import com.imc.iss.groovy.order.Order import com.imc.iss.groovy.order.OrderItem import com.imc.vocabulary.Schema /* *  Binding *  groovyLogger : GroovyLogger *  groovyCtxUtil : GroovyCtxUtil *  order : Order *  salesItemsTree *  userInfoList *  lookuptable/view and other default binding */ def creatorName = userInfo.getUsername(); groovyLogger.notifyInfo("creatorName = "+ creatorName) groovyLogger.notifyInfo("Quote ID : "+ salesItemsTree.getQuoteURI()); //groovyLogger.notifyError("Quote ID : "+ salesItemsTree.getQuoteURI()); //Logic to get relevant OrgUnits to set default Sales Office and Sales Organization values //MX Office Equipment def salesOrg = "https:///OrgUnit#ffaaf902baea429f92451aba6384f407"; //MX Office Equipment DE def salesOffice = "https:///OrgUnit#f7aefaad605d4800a81ace7d381e5883"; groovyLogger.notifyInfo("salesOrg : "+ salesOrg); groovyLogger.notifyInfo("salesOffice : "+ salesOffice); order.setRelationAttribute(Schema.hasSalesOffice.getUriAsString(), salesOffice); order.setRelationAttribute(Schema.hasSalesOrg.getUriAsString(), salesOrg); ``` ## Expected output No output expected. ## Script execution A script that you upload for this extension point is run automatically when a user [creates a sales order](/docs/quote-to-sales-order-creation#create-a-sales-order) from a submitted quote. ### Create a sales order 1. [Open a quote](/docs/manage-quotes#open-quotes). 2. From the bottom button bar, select **ERP Helpers** > **Order**. 3. From the bottom button bar, select **Generate Sales Orders**. Zilliant CPQ executes the uploaded Groovy script. On the **New Order** screen, on the **Overview** tab, default values of specific fields follow the logic defined in the script.