Dynamics 365 Business Central: How to flow/pass custom field values from Sales Order to Production Order
Explains how to carry custom field values from a Sales Order to the Production Order created from it by subscribing to events raised in codeunit 99000792 Create Prod. Order from Sale. One event handles header to header mapping and another handles line to line mapping, with sample AL code including table and page extensions.

post Dynamics 365 Lab
Key points
- Use event OnAfterCreateProdOrderFromSalesLine to pass values from Sales Header to Production Order header
- Use event OnCreateProductionOrderOnBeforeProdOrderLineModify to pass values from Sales Line to Production Order Line
- Extend both source (Sales Header/Line) and target (Production Order/Line) tables to add custom fields
- Subscribe to standard events without modifying core codeunit logic
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.
- codeunit 99000792 “Create Prod. Order from Sale”
- table 36 “Sales Header”
- table 37 “Sales Line”
- table 5405 “Production Order”
- table 5406 “Prod. Order Line”
Possibly related
No source states these links: they share an object, a model read them, or a person found the same subject.
- BC Friday Tips #56 Understand Missing Fields in Copy Documents — possibly related: both name Table 37 “Sales Line”
- BC Friday Tips #84 Why Is Your Item Missing from the Sales Line Lookup? — possibly related: both name Table 37 “Sales Line”
- Business Central Development Serie - Part 2b: AI for BC Development — The Knowledge Gap That Ships to Production — possibly related: both name Table 37 “Sales Line”
- Dynamics 365 Business Central: Add a Scan Barcode action and scan multiple/Continious scanning (Invoke barcode scanning programmatically from AL) — possibly related: both name Table 37 “Sales Line”
- Dynamics 365 Business Central: Entering Quantities/Amounts by Calculation and Negative Numbers — possibly related: both name Table 37 “Sales Line”
- Dynamics 365 Business Central: How to note the records that the user has selected on the Subpage/Lines (Page.SetSelectionFilter in part) — possibly related: both name Table 37 “Sales Line”
- Dynamics 365 Business Central: How to quickly check if a field is a primary key field — possibly related: both name Table 37 “Sales Line”
- Dynamics 365 Business Central: Quickly get next Sequence/Entry Number (without using FindLast -> Entry No. + 1) — possibly related: both name Table 37 “Sales Line”
- Dynamics 365 Business Central: Use a default quantity of 1 for all types on documents – Customization — possibly related: both name Table 37 “Sales Line”
- Implementing a Multi-Step Process for AI Recommendations in Business Central — possibly related: both name Table 37 “Sales Line”
Context
- Features: Production Order creation from Sales Order, Event-based customization, Custom field mapping, Item Order and Project Order types
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.