---
id: object/table/20404
type: object
title: Table 20404 "Qlty. Inspection Gen. Rule"
summary: Table 20404 "Qlty. Inspection Gen. Rule" in Quality Management (Microsoft.QualityManagement.Configuration.GenerationRule). 20 fields, 10 public procedures. Introduced in BC29, still in BC30, changed in BC30.
tier: official
language: en
tags:
  - table
  - quality management
versions:
  introduced: "29"
  last_changed: "30"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: 9edb54f4f1c0d1fe9dec3d923b880a347fd2a3fab6492a8e177bc4708444063c
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/Quality%20Management/app/src/Configuration/GenerationRule/QltyInspectionGenRule.Table.al
    title: src/Apps/W1/Quality Management/app/src/Configuration/GenerationRule/QltyInspectionGenRule.Table.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/11121
    - change/bcapps/10270
    - change/bcapps/7938
    - change/bcapps/8556
object_type: table
object_id: 20404
name: Qlty. Inspection Gen. Rule
caption: Quality Inspection Generation Rule
namespace: Microsoft.QualityManagement.Configuration.GenerationRule
app: Quality Management
extends: null
first_version: "29"
last_version: "30"
present_in:
  - "29"
  - "30"
changed_in:
  - "30"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 20
  procedures: 19
  events: 0
  subscribers: 0
relations:
  out: 3
  referenced_by: 0
  pages: 1
  extended_by: 0
  event_subscribers: 0
  calls: 2
  called_by: 0
  implements: 0
---

# Table 20404 "Qlty. Inspection Gen. Rule"

> Table 20404 "Qlty. Inspection Gen. Rule" in Quality Management (Microsoft.QualityManagement.Configuration.GenerationRule). 20 fields, 10 public procedures. Introduced in BC29, still in BC30, changed in BC30.

Quality Management · Microsoft.QualityManagement.Configuration.GenerationRule · captioned "Quality Inspection Generation Rule" · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/Quality%20Management/app/src/Configuration/GenerationRule/QltyInspectionGenRule.Table.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Caption | Quality Inspection Generation Rule |
| DataClassification | CustomerContent |
| LookupPageId | Qlty. Inspection Gen. Rules |
| DrillDownPageId | Qlty. Inspection Gen. Rules |
| Permissions | tabledata "Qlty. Management Setup" = r, tabledata "Qlty. Inspection Template Hdr." = r |

## Fields

Explanation: the field's ToolTip in the code; without one, the ToolTip of a page control bound to the field (marked via the page); without that, its Caption (marked caption) when that differs from the name.

| No. | Name | Type | Explanation | Notes |
|---|---|---|---|---|
| 1 | Entry No. | Integer | — |  |
| 2 | Sort Order | Integer | Specifies the order to look for matches. The smallest value will get looked at first. |  |
| 3 | Intent | Enum "Qlty. Gen. Rule Intent" | Specifies the intent of this rule. This is used for categorization and to help control the editability of various trigger fields. | enum [Enum 20460 "Qlty. Gen. Rule Intent"](../enum/20460.md) |
| 4 | Schedule Group | Code[20] | Specifies a group which allows a schedule to refer to multiple inspection generation rules. |  |
| 10 | Template Code | Code[20] | Specifies the Quality Inspection Template to use when the conditions match. | TableRelation [Table 20402 "Qlty. Inspection Template Hdr."](../table/20402.md) ("Qlty. Inspection Template Hdr.".Code); NotBlank |
| 12 | Source Table No. | Integer | Specifies the table for this rule. For example for receiving to a Purchase Line, you would use table 39. For production typically 5409 for Production Order Routing Line. | TableRelation AllObjWithCaption."Object ID" where("Object Type" = const(Table), "Object ID" = field("Table ID Filter")) |
| 13 | Condition Filter | Text[2048] | Specifies the criteria for defining when to use this template. For example, if you wanted to only use a template for a certain item then you would define that item here. |  |
| 14 | Description | Text[100] | Specifies an explanation of this rule. |  |
| 15 | Table Caption | Text[250] | Specifies the table for this rule. For example for receiving to a Purchase Line, you would use table 39. For production typically 5409 for Production Order Routing Line. | FlowField: lookup(AllObjWithCaption."Object Caption" where("Object Type" = const(Table), "Object ID" = field("Source Table No."))); not editable |
| 18 | Table ID Filter | Integer | — | FlowFilter |
| 19 | Item Filter | Text[2048] | Specifies the item specific criteria for defining when to use this template. |  |
| 20 | Item Attribute Filter | Text[2048] | Specifies the item attribute specific criteria for defining when to use this template. |  |
| 21 | Activation Trigger | Enum "Qlty. Gen. Rule Act. Trigger" | Specifies whether the generation rule is active for manually created inspections only, automatically created inspections only, both, or disabled entirely. | enum [Enum 20459 "Qlty. Gen. Rule Act. Trigger"](../enum/20459.md) |
| 22 | Warehouse Receipt Trigger | Enum "Qlty. Whse. Receipt Trigger" | Specifies whether the generation rule should be used to automatically create inspections based on a Warehouse Receipt Trigger. | enum [Enum 20450 "Qlty. Whse. Receipt Trigger"](../enum/20450.md) |
| 23 | Purchase Order Trigger | Enum "Qlty. Purchase Order Trigger" | Specifies whether the generation rule should be used to automatically create inspections based on a purchase receive trigger. | enum [Enum 20452 "Qlty. Purchase Order Trigger"](../enum/20452.md) |
| 24 | Sales Return Trigger | Enum "Qlty. Sales Return Trigger" | Specifies whether the generation rule should be used to automatically create inspections based on a sales return receive trigger. | enum [Enum 20453 "Qlty. Sales Return Trigger"](../enum/20453.md) |
| 25 | Transfer Order Trigger | Enum "Qlty. Transfer Order Trigger" | Specifies whether the generation rule should be used to automatically create inspections based on a transfer receive trigger. | enum [Enum 20454 "Qlty. Transfer Order Trigger"](../enum/20454.md) |
| 26 | Production Order Trigger | Enum "Qlty. Production Order Trigger" | Specifies whether the generation rule should be used to automatically create inspections based on a Production Order Trigger. | enum [Enum 20406 "Qlty. Production Order Trigger"](../enum/20406.md) |
| 27 | Assembly Trigger | Enum "Qlty. Assembly Trigger" | Specifies whether the generation rule should be used to automatically create inspections based on an assembly trigger. | enum [Enum 20457 "Qlty. Assembly Trigger"](../enum/20457.md) |
| 28 | Warehouse Movement Trigger | Enum "Qlty. Warehouse Trigger" | Specifies whether the generation rule should be used to automatically create inspections based on a warehouse movement trigger. | enum [Enum 20438 "Qlty. Warehouse Trigger"](../enum/20438.md) |

## Keys

- Key1: Entry No. (clustered)
- Key2: Sort Order
- Key3: Sort Order, Intent
- Key4: Template Code, Source Table No., Sort Order
- Key5: Source Table No.
- Key6: Activation Trigger, Sort Order
- Key7: Template Code, Schedule Group, Description

## Procedures

- `SetEntryNo()` (internal): Assigns the next entry number when the generation rule has no entry number.
- `UpdateSortOrder()` (internal): Assigns a sort order after the current highest value when the sort order is zero or one.
- `HandleOnAssistEditSourceTable()` (internal): Looks up a source table from configured tables and validates the selected table number.
- `AssistEditConditionTableFilter(): Boolean`: Provides the ability to assist edit a condition filter.
- `AssistEditConditionItemFilter(): Boolean`: Provides the ability to assist edit an item filter.
- `AssistEditConditionAttributeFilter()`: Provides the ability to assist edit an attribute filter.
- `GetTemplateCodeFromRecordOrFilter(OnlyFilters: Boolean): Code[20]`: Gets the template code from either the selected record, or the filter.
- `SetIntentAndDefaultTriggerValuesFromSetup()` (internal): Sets the default automatic inspection creation triggers for generation rules based on the values set in Quality Management Setup
- `TryInferGenerationRuleIntent(var QltyGenRuleIntent: Enum "Qlty. Gen. Rule Intent"; var QltyCertainty: Enum "Qlty. Certainty")` (internal): Attempts to infer the generation rule intent and certainty without propagating inference errors.
- `InferGenerationRuleIntent(var QltyGenRuleIntent: Enum "Qlty. Gen. Rule Intent"; var QltyCertainty: Enum "Qlty. Certainty")`: Gets the intent of the generation rule if it can be determined

Plus 9 local procedures.

## Triggers

OnInsert, OnModify

## Relations

- drill-down page [Page 20405 "Qlty. Inspection Gen. Rules"](../page/20405.md)
- lookup page [Page 20405 "Qlty. Inspection Gen. Rules"](../page/20405.md)
- Template Code: TableRelation [Table 20402 "Qlty. Inspection Template Hdr."](../table/20402.md)

## Pages and codeunits on this table

- [Page 20405 "Qlty. Inspection Gen. Rules"](../page/20405.md) (source table)

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 20403 "Qlty. Filter Helpers"](../codeunit/20403.md) (9 calls: `AssistEditConditionAttributeFilter → BuildItemAttributeFilter2048`, `AssistEditConditionItemFilter → BuildFilter`, `AssistEditConditionTableFilter → BuildFilter`, …)
- [Codeunit 20405 "Qlty. Inspec. Gen. Rule Mgmt."](../codeunit/20405.md) (1 call: `HandleOnAssistEditSourceTable → GetFilterForAvailableConfigurations`)

## Recent changes

- 2026-09-10 [#11121 Fix generation rule source table validation](../../changes/bcapps/11121.md) (main, BC30, fix)
- 2026-08-20 [#10270 [Quality Management] Repair and improve XML documentation of procedures](../../changes/bcapps/10270.md) (main, BC30, refactor)
- 2026-07-16 [#7938 Bugs/632378 make quality inspection gen rule warning actionable](../../changes/bcapps/7938.md) (main, BC30, fix)
- 2026-07-08 [#8556 [Quality Management] Enforce rules and restrictions with indirect and implicit permissions](../../changes/bcapps/8556.md) (main, BC30, feature)

## Across versions

- Present in: BC29-30
- Changed (declaration) in: BC30

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "table", object_name: "Qlty. Inspection Gen. Rule")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
