Sales Order and Purchase Order Retention and Archive
The Order Retention and Archive functionality preserves Sales Orders and Purchase Orders that standard Business Central would normally delete after completion. In the fashion and apparel industry, retaining order history is essential to gain insights into collection performance and customer buying behaviour. The system automatically archives orders when they are fully shipped or invoiced, preserving all apparel-specific information including style lines, style matrix, Season Code, and Division Code.
Order Retention Configuration
You can use the Fashion & Apparel Setup page to configure order retention behaviour for your apparel operations. By enabling retention settings, you ensure that completed orders are preserved in the archive instead of being deleted by standard Business Central processes.
-
If the Retain Sales Order After Completion toggle is turned on, the system retains completed sales orders for the specified archive period.
-
If the Retain Purchase Order After Completion toggle is turned on, the system retains completed purchase orders for the specified archive period.
-
If no archive period is specified but retention is enabled, orders are retained indefinitely.
The system only archives orders that meet the completion criteria.
To configure order retention settings, follow these steps:
-
Select the Search icon
, enter the Fashion & Apparel Setup, and then choose the related link. The Fashion & Apparel Setup page opens. -
On the General FastTab, configure the following retention fields:
| Field | Description |
|---|---|
| Retain Sales Order After Completion | Specifies whether completed sales orders should be retained in the archive instead of being deleted. When enabled, fully shipped sales orders are moved to the Sales Order Archives. |
| Retain Purchase Order After Completion | Specifies whether completed purchase orders should be retained in the archive instead of being deleted. When enabled, fully invoiced purchase orders are moved to the Purchase Order Archives. |
| Sales Order Archive Period | Specifies how long archived sales orders are retained. Leave blank for indefinite retention. |
| Purchase Order Archive Period | Specifies how long archived purchase orders are retained. Leave blank for indefinite retention. |
Season-level archive configuration
You can also configure archive periods at the Season level. To configure season-specific retention:
-
Select the Search icon
, enter Seasons, and then choose the related link. -
On the Season Card, configure the following fields:
| Field | Description |
|---|---|
| Sales Order Archive Period | Specifies the retention period for sales orders associated with this season. |
Completed Order
A Completed Order is a sales order or purchase order that has been fully processed with no remaining outstanding quantities. The system automatically marks an order as completed after posting, when all item lines have been fully shipped and invoiced (for sales orders) or fully received and invoiced (for purchase orders). Once marked as completed, the order becomes read-only and is retained in the system until it is moved to the archive.
How an order becomes completed
-
When a sales invoice is posted, the system checks whether all item lines have an Outstanding Quantity of zero and a quantity shipped not invoiced of zero. If both conditions are met, the system sets the Completed Order boolean to turn on and records the last posting date.
-
When a purchase invoice is posted, the system checks whether all item lines have an outstanding quantity of zero and a quantity received not invoiced of zero. If both conditions are met, the system sets the Completed Order boolean to turn on and records the last posting date.
-
If any item line still has an outstanding or un-invoiced quantity, the order remains open.
Behaviour of a completed order
-
When you open a completed order, the entire document is read-only. Header fields, line fields, and style matrix quantities cannot be modified.
-
When you attempt to reopen a completed order, the system blocks the action and displays an error.
Sales order archive
The Sales Order Archive page displays archived sales orders with their complete history, including all apparel-specific information. When standard Business Central would delete a completed sales order, the retention system preserves the order in the archive.
-
When you open an archived sales order, the system displays all header information exactly as it existed at the time of archiving.
-
When you select the Style Lines action, the system displays the archived style lines for the order.
-
When you select the Style Matrix action, the system displays the archived style matrix with size quantities.
-
Archived orders are read-only and cannot be modified, consistent with standard Business Central archive behaviour.
The archived style matrix is an exact copy of the style matrix at the time of archiving.
To view archived Sales Orders:
-
Select the Search icon
, enter Sales Order Archives, and then choose the related link. The Sales Order Archive List page opens. -
Select the archived order you want to view and choose View or double-click to open the archive card.
The following apparel-specific fields are available on the Archived Sales Order:
| Field | Description |
|---|---|
| Season Code | Displays the season code that was assigned to the order at the time of archiving. This field is read-only. |
| Division Code | Displays the division code that was assigned to the order at the time of archiving. This field is read-only. |
| Order Type Code | Displays the order type code for apparel-specific order categorization. This field is read-only. |
| Cancel Date | Displays the cancel date that was set on the order. This field is read-only. |
| Hold Code | Displays any hold code that was assigned to the order. This field is read-only. |
| Country Size Conversion Code | Displays the size conversion code used for international sizing. This field is read-only. |
| Factoring | Indicates whether factoring was enabled on the order. This field is read-only. |
To view Archived Style Lines:
-
On the Archived Sales Order page, select Navigate > Style Lines.
-
The Sales Style Line Archive page opens displaying the archived style line details.
To view Archived Style Matrix:
-
On the Archived Sales Order page, select Navigate > Style Matrix.
-
The archived style matrix page opens displaying size quantities exactly as they existed at archiving.
The archived style matrix is informational only and cannot be edited.
Purchase order archive
The Purchase Order Archive page displays archived purchase orders with their complete history, including all apparel-specific information. When standard Business Central deletes a completed purchase order, the retention system preserves the order in the archive.
-
When you open an archived purchase order, the system displays all header information exactly as it existed at the time of archiving.
-
When you select the Style Lines action, the system displays the archived style lines for the order.
-
When you select the Style Sizes action, the system displays the archived style size matrix with quantities.
-
Archived orders are read-only and cannot be modified, consistent with standard Business Central archive behaviour.
The archived style sizes display is an exact copy of the data at the time of archiving.
To view archived Purchase Orders:
-
Select the Search icon
, enter Purchase Order Archives, and then choose the related link. The Purchase Order Archive List page opens. -
Select the archived order you want to view and choose View or double-click to open the archive card.
The following apparel-specific fields are available on the Archived Purchase Order:
| Field | Description |
|---|---|
| Season Code | Displays the season code that was assigned to the order at the time of archiving. This field is read-only. |
| Division Code | Displays the division code that was assigned to the order at the time of archiving. This field is read-only. |
To view Archived Style Lines:
-
On the Archived Purchase Order page, select Navigate > Style Lines.
-
The Purchase Style Line Archive page opens displaying the archived style line details.
To view Archived Style Sizes:
-
On the Archived Purchase Order page, select Navigate > Style Sizes.
-
The archived style sizes page opens displaying size quantities exactly as they existed at archiving.
The archived style sizes display is informational only and cannot be edited.
Retained through posting date, work date and setup (enable)
The retention feature is inactive until explicitly enabled in the Fashion & Apparel Setup page. Sales Order and Purchase Order retention settings can be enabled or disabled independently.
-
When Retain Sales Orders After Completion toggle is turned on, completed sales orders are preserved in Sales Order Archives instead of being deleted by standard Business Central processes. The system calculates the retention expiry as: Posting Date + Sales Order Archive Period.
-
When Retain Purchase Orders After Completion toggle is turned on, completed purchase orders are preserved in Purchase Order Archives page instead of being deleted. The system calculates the retention expiry as: Posting Date + Purchase Order Archive Period.
-
When the current Work Date exceeds the expiry date, the order becomes eligible for archiving by the batch job.
Only orders with Completed Order toggle turned on are eligible for archiving.
Manually moving order to the archive list
In addition to automatic archiving through the batch job, you can manually move completed orders to the archive using by running the Completed Orders to Archive report.
Archiving Logic
An order qualifies for manual archiving when all the following conditions are met:
-
The Completed Order toggle is turned on (fully invoiced).
-
The Retain Orders After Completion toggle is turned on in Fashion & Apparel Setup page.
When an order is manually archived:
-
The system creates a complete copy of the order in the respective archive (Sales Order Archives or Purchase Order Archives), preserving all header data, line data, style lines, style matrix, Season Code, and Division Code.
-
The original order is removed from the active orders list.
-
The archived copy is read-only and cannot be modified.
To manually archive a Sales Order:
-
Open the Sales Order you want to archive. The Completed Order toggle must be turned on
-
Select Actions > Archive Document.
-
The system moves the order to Sales Order Archives and removes it from the active Sales Orders list.
To manually archive a Purchase Order:
-
Open the Purchase Order you want to archive. The Completed Order toggle must be turned on.
-
Select Actions > Archive Document.
-
The system moves the order to Purchase Order Archives and removes it from the active Purchase Orders list.
To use the Completed Orders to Archive report:
-
Select the Search icon
, enter Completed Orders to Archive, and then choose the related link. -
On the request page, configure the filter options as needed (for example, filter by Season Code, Division Code, or Posting Date range).
-
Select Preview to review which orders will be archived before processing, or select OK to process and archive all qualifying orders.
If the Retain Orders After Completion toggle is not enabled in Fashion & Apparel Setup, the Archive Document action is not available on the order.
Sales order list - season and division fields
The Sales Order List page displays Season and Division fields to enable filtering and analysis of orders by collection and business unit. These apparel-specific fields are available as columns that you can show, hide, and reorder using standard Business Central personalization.
-
When you filter by Season Code, the system displays only sales orders assigned to the selected season(s).
-
When you filter by Division Code, the system displays only sales orders assigned to the selected division(s).
-
When you filter by both Season and Division, the system displays orders matching both criteria.
Season and Division fields are visible only when Apparel Management, show in user interface column is toggle on in Application Area
Available fields on sales order list
The following apparel-specific fields are available on the Sales Order List page:
| Field | Description |
|---|---|
| Season Code | Specifies the season code assigned to the sales order. Use this field to filter orders by collection season. |
| Division Code | Specifies the division code assigned to the sales order. Use this field to filter orders by business division. |
| Completed Order | Specifies whether the sales order is marked as completed. Completed orders are highlighted with a visual style indicator. |
To filter Sales Orders by Season and Division:
-
Select the Search icon
, enter Sales Orders, and then choose the related link. The Sales Order List page opens. -
Use the filter pane or column filters to enter filter criteria:
-
For a single value: Enter the code directly (e.g., SS25)
-
For multiple values: Use pipe notation (e.g., SS25|FW25|SS26)
-
For a range: Use range notation (e.g., SS25..FW26)
-
The list automatically refreshes to display only orders matching your filter criteria.
To personalize Season and Division columns:
-
On the Sales Order List page, select Settings > Personalize.
-
In the personalization mode, you can:
-
Show or hide the Season Code and Division Code columns
-
Drag columns to reorder their position
-
Select Done to save your personalization.
The Season and Division values displayed on the list match the values stored on the Sales Order header.
Purchase Order list - Season and Division fields
The Purchase Order List page displays Season and Division fields to enable filtering and analysis of purchase orders by collection and business unit. These apparel-specific fields are available as columns that you can show, hide, and reorder using standard Business Central personalization.
-
When you filter by Season Code, the system displays only purchase orders assigned to the selected season(s).
-
When you filter by Division Code, the system displays only purchase orders assigned to the selected division(s).
-
When you filter by both Season and Division, the system displays orders matching both criteria.
Season and Division fields are only visible when the Apparel Management Application Area is enabled.
Available fields on purchase order list
The following apparel-specific fields are available on the Purchase Order List page:
| Field | Description |
|---|---|
| Season Code | Specifies the season code assigned to the purchase order. Use this field to filter orders by collection season. |
| Division Code | Specifies the division code assigned to the purchase order. Use this field to filter orders by the business division. |
| Completed Order | Specifies whether the purchase order is marked as completed. Completed orders are highlighted with a visual style indicator. |
To filter Purchase Orders by Season and Division:
-
Select the Search icon
, enter Purchase Orders, and then choose the related link. The Purchase Order List page opens. -
Use the filter pane or column filters to enter filter criteria:
-
For a single value: Enter the code directly (e.g., DIV01)
-
For multiple values: Use pipe notation (e.g., DIV01|DIV02|DIV03)
-
For a range: Use range notation (e.g., DIV01..DIV10)
-
The list automatically refreshes to display only orders matching your filter criteria.
To personalize Season and Division columns:
-
On the Purchase Order List page, select Settings > Personalize.
-
In the personalization mode, you can:
-
Show or hide the Season Code and Division Code columns
-
Drag columns to reorder their position
-
Select Done to save your personalization.
The Season and Division values displayed on the list match the values stored on the Purchase Order header.
Job batch
The Archive Completed Orders batch job automatically processes completed Sales Orders and Purchase Orders and moves them to the archive based on the retention configuration in Fashion & Apparel Setup.
The system considers the following orders for archiving:
-
Sales Orders where the Completed Order toggle is Turned on, and the Posting Date + Sales Order Archive Period is on or before the current Work Date.
-
Purchase Orders where the Completed Order toggle is Turned on, and the Posting Date + Purchase Order Archive Period is on or before the current Work Date.
The system does not process:
-
Orders where the Completed Order toggle is Turned on.
-
Orders where no Archive Period is configured — these are retained indefinitely until manually archived.
To run the batch job manually, follow these steps:
-
Open the Archive Completed Orders page.
-
Set filter options as needed, for example, filter by Posting Date range, Season Code, or Division Code.
-
Select OK to execute. The system processes all qualifying orders and moves them to the archive.
Setting up automatic execution (job queue)
To schedule automatic execution, follow these steps:
-
Open the Job Queue Entries list page.
-
Select the New action.
-
In the Object Type to Run field, select Report.
-
In the Object ID to Run field, enter the Archive Completed Orders report ID(72644410 – for Archive Completed Purchase Orders, 72644409 -for Archive Completed Sales Orders).
-
In the Earliest Start Date/Time field, enter the date and time from which the job should become active.
-
In the Status field, set to Ready to activate the scheduled job.