Manage Sequence Numbers

Salesforce B2C Commerce uses sequence numbers as unique identifiers for automatically generated object instances.

For example, when creating an order, an order sequence number is generated and can be used to identify the order. B2C Commerce enables you to configure sequence numbers for single sites and entire organizations with many sites. Order Numbers are associated with Shipment and Invoice Numbers. If you configure Order Numbers to be site-specific, then Invoice and Shipment Numbers are also site-specific by default.

For some organizations, it's crucial that sequence numbers be managed across the entire organization. It’s especially important if external third-party organization-wide applications are involved in the management of customer and order data.

Note: Generated sequence numbers are guaranteed to be unique within each object type, but are not guaranteed to be sequential. A generated number can be higher or lower than a previously created number. As a result, sorting objects by generated sequence numbers is not guaranteed to sort them in their order of creation.
  1. Select Administration > Global Preferences > Sequence Numbers. Specify the global sequence number scheme (organizational) for the following:
    • Order Number
    • Invoice Number
    • Shipment Number
    • Customer Number
    • Gift Certificate Merchant ID
  2. Select site > Merchant Tools > Site Preferences > Sequence Numbers. Specify site-specific sequence number schemes to be used instead of the global sequence number schemes.
    1. Configure Order Number as follows, and click Apply:

      Unique per Organization (recommended): You must manage the number scheme in Global Preferences.

      Unique per Site: You can specify the site-specific numbering schemes for the following:
      • Order Number
      • Invoice Number
      • Shipment Number
      • Gift Certificate Merchant ID
    2. Configure Gift Certificate Merchant ID as follows, and click Apply:

      Unique per Organization (recommended): You must manage the number scheme in Global Preferences.

      Unique per Site: You can specify the site-specific numbering schemes for the Gift Certificate Merchant ID.

  3. Select Administration > Sites > Customer Lists > site. Specify the customer-list level sequence numbers.
    You can select how you want sequence numbers to behave:
    • Unique per Organization: (Recommended) The customer sequence numbers are unique across the organization and share configuration.
    • Unique per Customer List: The customer numbers can be formatted differently per customer list. This isn't recommended, because it can cause problems later if you decide to combine customer lists.
  4. In all three modules, you define sequence numbers as follows:
    1. Define the starting point.
    2. Format of all sequence numbers to ensure they start at an appropriate value.
    3. To reflect your company's needs, define special formatting.
    4. Change the format using the following formula:
      <prefix>{0,number,00000000}<suffix>

      Where:

      Parameter Description
      <prefix> Is any static string or number with which you want all order numbers to begin.
      {0 represents the start number created by the system that gets formatted with the format pattern.
      number Interpreted as a keyword that tells the system that the number is to be formatted as a numeric value.
      00000000 Specifies the number of numerical digits to include in the number.
      suffix Any static string or number with which you want all order numbers to end.

      For example:

      DW-{0,number,00000000}-05 translates to DW-00000007-05, where 00000007 is the next order number to be generated.

      XX-{0,number,00000000}-AA-{0,number,00000000}-ZZ would result in a generated number like XX-00000001-AA-00000001-ZZ.