---
title: "Create a Test Automatically on Production Output in Quality Inspector"
app: "Quality Inspector"
section: "How-to guides"
last_updated: "2025-12-17"
url: "https://insight-works.com/kb/quality-inspector/create-a-test-automatically-on-production-output-in-quality-inspector/"
---

# Create a Test Automatically on Production Output in Quality Inspector

This walkthrough goes through a scenario of having a quality inspection test created automatically when posting production output.

 Note: This walkthrough uses the standard Contoso data available in a demo Business Central 25 install.

Tests are triggered based on steps (especially for in-process/intermediate operations), but for final output on the last operation with known lots, it can also be using the item ledger entry. This set of steps focuses on the most common scenario of most people using production order routing lines.

### Prerequisites

- Use a W1-ENU-Extended base data with “Contoso” sample demo data as a baseline with the “SP-BOM2000” item which will be copied to a similar SP-BOM2000-T tracked item.
- Ensure the Assisted Setup Wizard was run.
- If any previous test cases were followed, set the Activation Trigger to “Disabled” on all existing test generation rules.
- On the Quality Inspection Setup, set _Show Test_to “Automatic and Manually Created Tests”.
- Have an item tracking code such as LOTALL configured to require lots and use lot warehouse tracking.
- Have a lot tracked item configured with production order replenishment. In Contoso data, copy item SP-BOM2000 to SP-BOM2000-T, and set the item tracking code on the lot tracked item to be “LOTALL”.
- Ensure there is sufficient work center and machine center calendars calculated for the routing used, and ensure there is sufficient inventory for the Bill of Material used.

### Create a Quality Inspection Test

1. Navigate to _Quality Inspection Templates_ in Business Central.
2. Click **+New**.
3. Input a unique, unused code into the _Code_field (e.g., If this is a clean install, this might be “EXAMPLEOUTPUT”).
4. Input a description in the _Description_field (e.g., If this is a clean install, this might be “Example Production Output”).
5. Select **Add Field(s) To This Template** (Quality Inspection Field Wizard opens).
6. Select **New Field** and select **Next**.
7. Input a unique, unused description (e.g., “Any field will do”) and tab off the field (the _short name (Field Code)_and _What type of data is it_options appear).
8. Leave the _Short name (Field Code)_unchanged (based on the description and attempt to be a unique, unused field code).
9. Select **A number**in the _What type of data is it _field.
10. Select **Next**(the next wizard page describes _Number Field Details_and displays a default value and allows defining the allowed values and pass values).
11. Locate the _Set the range of allowed values_section and set the _Minimum_field to 5 (minimum value you can enter).
12. Set the _Maximum_field to 50 (maximum value you can enter).
13. Locate the _Field Conditions_section and set the _Pass Min_to 10 (minimum value to be considered a Pass).
14. Set the _Pass Max_field to 20 (maximum value to be considered a Pass).
15. Select **Finish**.

The Add Field Wizard closes, and the new field is added to the Quality Inspection Template.

### Create a Test Generation Rule

Complete the following immediately after completing _Create a Quality Inspection Test_.

1. Select **Test Generation Rules** (_Quality Inspection Test Generation Rules_ page opens, filtered to the above template).
2. Select **Create Production Rule**.
3. Select your new template in the _Choose Template_ field.
4. Select **Next**.
5. Select **Production Orders** in the _Choose whether this is for production orders or assembly orders _field.
6. Select **Next**, leave all fields blank, and select **Next**.
7. Select “SP-BOM2000-T” (or the lot tracked item configured with production replenishment configured in the prerequisites) in the _Specific Item _field.
8. Select **Next**.
9. Ensure _When Output is Posted_ is selected in the _Automatically Create Test _field.
10. Select **Finish**.

After the wizard closes, a test generation rule is created.

### Use the Test Generation Rule to Create a Quality Inspection Test

Complete the following immediately after completing _Create a Test Generation Rule_.

1. Locate the Test Generation Rule record you created on the Test Generation Rules page.
2. Modify the following fields:

   1. Activation Trigger: Manual or Automatic
   2. Production Trigger: When Output is Posted
3. Close the following pages if they are still open:

   1. Test Generation Rules
   2. Quality Inspection Template
   3. Quality Inspection Templates
4. Navigate to _Released Production Orders_.
5. Select **+New**.
6. Tab off the field (generates a document number) on the _Released Production Order_ page.
7. Ensure the _Source Type_ is set to “Item”.
8. Set the _Source No._ to “SP-BOM2000-T” or the lot tracked item configured with production replenishment configured in the pre-requisites.
9. Set the _Quantity_ field to be “5”.
10. Select **Refresh Production Order**, accept all defaults, and select **OK**.
11. Select the new line in the _Lines _field.
12. Select **Line** and select **Production Journal**.
13. Locate _Output_’s last line for the last operation and set:

   1. Output Quantity: 5
   2. All other Output Quantity fields: 0
   3. All Consumption Quantity fields: 0
14. Ensure the last operation for the entry type of output selected, locate the _Line_ section, and select **Item Tracking Lines**.
15. Set the appropriate tracking details, such as Lot No. and Quantity (base) to be 5.
16. Select **Close**.
17. Navigate to the _Production Journal_ worksheet and select **Home** / **Post**.
18. Select **Yes** when prompted with “Do you want to post the journal lines?”
19. Select **OK** if prompted with “The journal lines were successfully posted.”

### End Result

If the pre-requisites and steps were followed, a Quality Inspection Test/Order opens with the following:

- Quantity (base): 5
- Status: Open
- Item No.: SP-BOM2000-T (or the lot tracked item configured with production replenishment configured in the prerequisites)
- Lot No.: The lot defined in the previous steps.
- Template Code: The template configured in the earlier steps.
