OrderSettings

Represents order settings.

In the package manifest, all organization settings metadata types are accessed using the Settings name. See Settings for details.

Parent Type 

This type extends Metadata and inherits its fields.

File Suffix and Directory Location 

There is one OrderSettings component in a file named Order.settings in the settings folder. The .settings files are different from other named components because there’s only one settings file for each settings component.

Version 

Introduced in API version 30.0.

Fields 

enableEnhancedCommerceOrders 

  • Type: boolean
  • Required: No
  • Introduced: API version 48.0
  • Description: Indicates whether enhanced commerce orders are enabled for the org (true) or not (false). This preference is available only in orgs with the Salesforce Order Management license. Default value is false.

enableNegativeQuantity 

  • Type: boolean

  • Required: No

  • Description: Indicates whether users in the org can add order products with quantities of less than zero (true) or not (false).

    To enable this preference, enableOrders must be set to true.

enableOptionalPricebook 

  • Type: boolean
  • Required: No
  • Description: Indicates whether users in the org can create orders without price books (true) or not (false). For more information, see Enable Orders Without Price Books in Salesforce Help.

enableOrderEvents 

  • Type: boolean
  • Required: No
  • Description: Indicates whether order events are enabled for the org (true) or not (false). For more information, see OrderStatusChangedEvent in the Platform Events Developer Guide.

enableOrders 

  • Type: boolean
  • Required: Yes
  • Description: Indicates whether orders are enabled for the org (true) or not (false).

enableOrderWithMultiplePriceBooks 

  • Type: boolean

  • Required: No

  • Introduced: API version 60.0

  • Description: Indicates whether users in the org can create orders containing order items that refer to multiple price books (true) or not (false). To enable this preference, enableOrders and enableEnhancedCommerceOrders must be set to true.

    This field helps to offer different pricing structures for various customer segments, regions, or promotional periods.

enableReductionOrders 

  • Type: boolean

  • Required: No

  • Description: Indicates whether reduction orders are enabled for the org (true) or not (false). For more information, see Reduction Orders in Salesforce Help.

    To enable this preference, enableOrders must be set to true.

enableZeroQuantity 

  • Type: boolean

  • Required: No

  • Introduced: API version 42.0

  • Description: Indicates whether users in the org can add order products with quantities of zero (true) or not (false). Default value is false.

    To enable this preference, enableOrders must be set to true.

Declarative Metadata Sample Definition 

This is a sample OrderSettings component.

1<?xml version="1.0" encoding="UTF-8"?>
2<OrderSettings xmlns="http://soap.sforce.com/2006/04/metadata">
3    <enableNegativeQuantity>false</enableNegativeQuantity>
4    <enableZeroQuantity>false</enableZeroQuantity>
5    <enableOrders>true</enableOrders>
6    <enableReductionOrders>true</enableReductionOrders>
7    <enableEnhancedCommerceOrders>true</enableEnhancedCommerceOrders>
8    <enableOptionalPricebook>false</enableOptionalPricebook>
9    <enableOrderEvents>false</enableOrderEvents>
10    <enableOrderWithMultiplePriceBooks>false</enableOrderWithMultiplePriceBooks>
11</OrderSettings>

The following is an example package.xml that references the previous definition.

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <types>
4        <members>Order</members>
5        <name>Settings</name>
6    </types>
7    <version>68.0</version>
8</Package>

Wildcard Support in the Manifest File 

The wildcard character * (asterisk) in the package.xml manifest file doesn’t apply to metadata types for feature settings. The wildcard applies only when retrieving all settings, not for an individual setting. For details, see Settings. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.