--- title: "Sub batch generation" slug: "sub-batch-generation" description: "Automatically generate and register sub-batches from purchase and production orders to support unique identification and efficient inventory control." updated: 2026-09-18T14:24:36Z published: 2026-09-18T14:24:36Z canonical: "docs.staedean.com/sub-batch-generation" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.staedean.com/llms.txt > Use this file to discover all available pages before exploring further. # Sub batch generation Sub-batches can be automatically generated and registered in inventory upon registration from purchase orders and batch orders/production orders. For this purpose, it is possible to use the **Create sub batch numbers** function in the **Registration** form. Once the **Create sub batch numbers** form is opened, users have the flexibility to generate sub-batches based on one of the following rules: 1. Define the size of each sub-batch (**Qty per sub batch**) and let the system automatically calculate the total **Number of sub batches** to be received. 2. Define the total **Number of sub batches** to be received and let the system automatically calculate the size of each sub-batch (**Qty per sub batch**) accordingly. The following information is displayed in the **Create sub batch numbers** form: - **Start** number defines the first number to be used for generating sub-batch numbers. - **End** number is calculated based on the **Start** number and the **Number of sub batches** being generated. - **Sub batch type** dropdown menu can be optionally used to select a sub-batch type (see [sub-batch type](https://docs.staedean.com/life-sciences/docs/sub-batch-type)) to be assigned to the generated sub-batches. - **Format** for the sub-batch number generation consists of the parent batch number plus a suffix (for example, “-###” will generate a sub-batch with a suffix with three digits). > [!NOTE] > Note > > If the **Sub batch number group** field has been populated in the item card of the material being registered, one or more of the above field(s) could be pre-populated and/or non-editable by the users (see [Advanced sub batch numbering](/life-sciences/docs/advanced-sub-batch-numbering) for additional details). It is possible to define a default format for the sub-batch number in the **Default sub batch ID format** field in the **General tab** of the **Inventory and warehouse management parameters** form (**Inventory management > Setup > Inventory and warehouse management parameters**). The default format is automatically inherited into the **Format** field in the **Create sub-batch numbers** form upon registration, but it can be manually modified. The sub-batch number is unique within a company. Upon registration and/or manual creation, the system will prevent users from generating duplicate sub-batch numbers. If sub-batches have already been generated for a batch and additional sub-batches for the same batch have to be registered at a later stage, the system will automatically suggest the next **Start** number to avoid generating duplicates. ## Example The Logistics Department needs to receive 100.00 Kg of material in 5 containers (sub-batches) of 20.00 Kg each. The warehouse operator will fill in the **Create sub batch numbers** form as follows: - **Qty per sub batch:** “20.00” - **Number of sub batches:** “5” - **Start:** “12” - **Format:** Batch number + “-###” The system will automatically generate five sub-batch numbers and assign 20.00 Kg to each sub-batch. Additionally, the **Create sub batch numbers** functionality has also been added to the item arrival journal lines in **Inventory management > Journals entries > Item arrival > Item arrival > Lines**. When a warehouse operator starts the arrival of incoming goods from the **Arrival overview** form (**Inventory management > Periodic > Arrival overview**), the system generates the item arrival journal, allowing the operator to automatically create sub-batch numbers. The Warehouse Management module introduces similar functionalities to [generate sub-batch numbers during material registration via mobile device](https://docs.staedean.com/life-sciences/docs/sub-batch-generation-via-mobile-device). When sub-batch items are shipped between legal entities in an intercompany (ICO) process, the sub-batch numbers and their properties can also be synchronized to the receiving legal entity, see [Sub batch integration in intercompany processes](/life-sciences/docs/sub-batch-integration-in-intercompany-processes). ## High-volume sub-batch registration via batch job After sub-batches are created on a registration line, they must be confirmed to register the material. For low volumes, users confirm the registration interactively with the **Confirm registration** button on the **Registration** form. For high volumes (for example, several thousand sub-batches on a registration line), confirming interactively can lead to long waits and browser session time-outs. To support high-volume scenarios, a **Confirm registration (batch processing)** option runs the sub-batch registration confirmation as a background D365 batch job, independently of the user’s browser session. This option is available on the **Registration** form when registering material for: - Purchase orders (**Accounts payable > Purchase orders > All purchase orders** or **Procurement and sourcing > Purchase orders > All purchase orders** > **Purchase order lines** FastTab > **Update line > Registration**). - Batch orders (**Production control > Production orders > All production orders** > **Production order** tab > **Inventory > Update registrations**, or **Process > Report as finished > Inventory > Registration**). > [!NOTE] > Note > > The existing **Confirm registration** button remains available and unchanged. The **Confirm registration (batch processing)** button is an additional option for high-volume registrations; the interactive path remains the recommended approach for low volumes. ### Confirm the registration as a batch job 1. On the **Registration** form, click **Add registration line** and enter the **Warehouse**, **Location**, and **License plate** (only if the location is license plate-managed) on the **Registration lines** FastTab. 2. Click **Create sub batch numbers**, define the parameters, and click **OK** to create the sub-batches. 3. Click the **Confirm registration (batch processing)** button on the **Registration lines** FastTab. The **Confirm registration batch process** dialog opens. The **Confirm registration (batch processing)** button is disabled when a **Confirm registration (batch processing)** batch job is already in progress for the same line, or when the line has already been confirmed (the **Receipt status** in the **Transactions** FastTab is not **Ordered**). 4. For purchase orders, when the **Purchase registration** checkbox is enabled in the item model group of the item on the registration line, complete the **Vendor batch details** in the dialog: - **Vendor batch date** – mandatory if **Mandatory vendor batch date** is enabled in the item model group. - **Use as manufacturing date** – if enabled, the **Vendor batch date** is set as the manufacturing date of the batch and sub-batch(es). - **Vendor expiry date** – mandatory if **Mandatory vendor batch expiry date** is enabled in the item model group. - **Use as expiration date** – if enabled, the **Vendor expiry date** is set as the expiration date of the batch and sub-batch(es). - **Country/region of origin 1** and **Country/region of origin 2**. - **Vendor batch number** – mandatory if **Mandatory vendor batch number** is enabled in the item model group. 5. Use the standard **Run in the background** FastTab to configure the batch job. The **Batch processing** option is enabled and cannot be disabled, so the process always runs as a batch job. 6. Click **OK**. The system validates the vendor batch details (for purchase orders), submits the batch job, and freezes the **Registration** form (**View only**, except the **Batch job history** and **Back** buttons) to prevent concurrent edits, duplicate confirmations, or additional lines while the job runs. A message confirms the job has started: - Purchase order: *“*Batch job for Purchase order %1 Sub batch registration has been started.*”* - Batch order: “Batch job for Batch order %1 Sub batch registration has been started.” You can leave the **Registration** form once the job has started. The batch job validates and confirms the registration of all lines present when the job started, applying the same controls as the interactive **Confirm registration** (location, license plate, and the item’s storage condition, storage attribute, and container configuration check methods). > [!NOTE] > Note > > Quality orders that would be generated during material registration are generated as a result of the batch job execution, not before it. Quality association behaviour is otherwise unchanged. When the job completes successfully (**Status** = **Ended**), the **Registration** form is unfrozen and the registered sub-batches are shown. If the **Registration** form is opened while a **Confirm registration (batch processing)** job is running for one of its lines, a warning is displayed and manual registration actions are disabled until the job completes: *“A sub batch registration batch job is in progress for this purchase order line. Manual registration actions are disabled until the job completes. Batch job ID: %1.”* (An equivalent message is shown for batch orders.) ### Monitor the batch job The **Batch job history** button is enabled, only if an error occurs during batch job execution. Click **Batch job history** to open the standard fields such as **Job ID**, **Job description** (for example, “*Purchase order %1 Sub batch registration*”), **Status**, **Created by**, and start/end date-time are shown, and all standard **Batch job history** functionality applies, including viewing messages with the **Logs** button. ### If the batch job fails If the job fails at any point, its **Status** is set to **Error** and the system: - Unfreezes the **Registration** form and makes it editable again. - Stores the error/warning message(s) in the **Batch job history** form (viewable with the standard **Logs** button). - Rolls back any sub-batch registrations performed during the run and automatically deletes the sub-batches that were created for the registration line. For purchase orders, any vendor batch details entered for the line are also cleared. - Retains the failed line records, together with the error message, for traceability. To reprocess, click **Create sub batch numbers** again to recreate the sub-batches, click **Confirm registration (batch processing)**, re-enter the vendor batch details (if applicable), and submit a new batch job. ## Related - [Sub-batch type](/sub-batch-type.md) - [Advanced sub batch numbering](/advanced-sub-batch-numbering.md) - [Sub-batch generation via mobile device](/sub-batch-generation-via-mobile-device.md)