community postSales & Receivablescommunity - not Microsoftreviewed - checked by Opus

Dynamics 365 Business Central: How to specify the No. Series when creating a Sales Order (Make Order) from Sales Quote – Customization

This post explains how to customize the Make Order process to specify the number series when converting a sales quote to a sales order, since the standard process automatically uses default numbering without allowing manual selection.

post Dynamics 365 Lab

Yun Zhu · 2025-05-27 · 869 words · about 4 min

Key points

  • Sales orders created from quotes normally use automatic numbering from the default no. series, but the Make Order action does not offer a choice of series like manual order creation does.
  • The default no. series must have Default Nos. enabled or an error prevents automatic order creation from quotes.
  • Customization uses the OnCreateSalesHeaderOnBeforeSalesOrderLineLockTable event in codeunit 86 Sales-Quote to Order to manipulate the order number.
  • The standard No. Series codeunit offers LookupRelatedNoSeries function to open a selection dialog and GetNextNo to retrieve the next number, enabling manual series selection during conversion.
  • Using OnBeforeInsertSalesOrderHeader event causes transaction lock errors due to Form.RunModal restrictions, so OnCreateSalesHeaderOnBeforeSalesOrderLineLockTable is the correct approach.

AL objects mentioned

As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.

No source states these links: they share an object, a model read them, or a person found the same subject.

Heads up

  • warning: “Please do not use OnBeforeInsertSalesOrderHeader event, it will cause the following error” (about codeunit Sales-Quote to Order, OnBeforeInsertSalesOrderHeader)

Context

  • Features: Make Order from Sales Quote, Number Series management, No. Series lookup, Automatic document numbering, Default numbering in quotes to orders

Source: Dynamics 365 Lab - Yun Zhu, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.