---
id: object/codeunit/20408
type: object
title: Codeunit 20408 "Qlty. Traversal"
summary: Codeunit 20408 "Qlty. Traversal" in Quality Management (Microsoft.QualityManagement.Configuration.SourceConfiguration). 21 public procedures. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - quality management
versions:
  introduced: "29"
  last_changed: null
  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: f01669e5dcdb78929230de2aaf58e15946e52951843a849899b58447fe12f82f
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/Quality%20Management/app/src/Configuration/SourceConfiguration/QltyTraversal.Codeunit.al
    title: src/Apps/W1/Quality Management/app/src/Configuration/SourceConfiguration/QltyTraversal.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/10270
    - change/bcapps/8556
object_type: codeunit
object_id: 20408
name: Qlty. Traversal
namespace: Microsoft.QualityManagement.Configuration.SourceConfiguration
app: Quality Management
extends: null
first_version: "29"
last_version: "30"
present_in:
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 30
  events: 0
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 2
  called_by: 5
  implements: 0
---

# Codeunit 20408 "Qlty. Traversal"

> Codeunit 20408 "Qlty. Traversal" in Quality Management (Microsoft.QualityManagement.Configuration.SourceConfiguration). 21 public procedures. Introduced in BC29, still in BC30.

Quality Management · Microsoft.QualityManagement.Configuration.SourceConfiguration · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/Quality%20Management/app/src/Configuration/SourceConfiguration/QltyTraversal.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Permissions | tabledata "Qlty. Inspect. Src. Fld. Conf." = r, tabledata "Qlty. Inspect. Source Config." = r, tabledata "Tracking Specification" = r, tabledata "Warehouse Entry" = r, tabledata "Warehouse Journal Line" = r, tabledata "Warehouse Receipt Line" = r, tabledata "Sales Line" = r, tabledata "Purchase Line... |

## Procedures

- `FindFromTableLinkedRecordWithToTable(SingleOnly: Boolean; AllowTrackingMapping: Boolean; var TempFromQltyInspectSourceConfig: Record "Qlty. Inspect. Source Config." temporary; var ToTableRecordRef: RecordRef; var FromTableRecordRef: RecordRef): Boolean` (internal): Finds a linked record based on the configured source configuration by traversing from a target table to a source table. Uses field mappings defined in the source configuration to match records between tables.
- `FindToTableLinkedRecordWithFromTable(SingleOnly: Boolean; AllowTrackingMapping: Boolean; var TempQltyInspectSourceConfig: Record "Qlty. Inspect. Source Config." temporary; var FromRecordRef: RecordRef; var ToTableRecordRef: RecordRef): Boolean` (internal): Finds a linked record based on the configured source configuration by traversing from a source table to a target table. Uses field mappings defined in the source configuration to match records between tables. This is the inverse operation of FindFromTableLinkedRecordWithToTable.
- `FindPossibleTargetsBasedOnConfigRecursive(InputTable: Integer; var TempAvailableQltyInspectSourceConfig: Record "Qlty. Inspect. Source Config." temporary): Boolean` (internal): Finds all possible target configurations recursively based on a source table number. This is used when manually creating an inspection to determine which source configurations are available for the given table. The procedure recursively searches through chained table relationships to find all paths ...
- `ApplySourceFields(var TargetRecordRef: RecordRef; var QltyInspectionHeader: Record "Qlty. Inspection Header"; RaiseErrorIfNoConfigIsFound: Boolean; ForceSetValues: Boolean): Boolean` (internal): Populates source fields in the Quality Inspection Header record based on the target record. Uses source configuration to traverse parent records if necessary to populate all required fields. This procedure is essential for automatically filling in inspection header fields (like Source Item No., Sour...
- `GetControlCaptionClass(InputQltyInspectionHeader: Record "Qlty. Inspection Header"; Input: Text): Text` (internal): Retrieves the dynamic caption text for a control based on source configuration field mappings. Used to display field captions from source documents (e.g., "Item No." vs "Product Code") in the inspection header UI. Caches results for performance.
- `GetControlVisibleState(InputQltyInspectionHeader: Record "Qlty. Inspection Header"; Input: Text): Boolean` (internal): Determines whether a control should be visible based on source configuration. Controls are visible only if there's a valid field mapping from the source document. Caches visibility state for performance.
- `DetermineControlInformation(InputQltyInspectionHeader: Record "Qlty. Inspection Header"; Input: Text)` (internal): Clears cached control information and forces re-evaluation of caption and visibility. Call this when source configuration or inspection header source records change to ensure controls display current information. Removes stale cache entries and triggers refresh.
- `FindSingleParentRecordWithVariant(ChildRecordVariant: Variant; var FoundParentRecordRef: RecordRef): Boolean` (internal): Finds the single parent record for a given child record using source configuration relationships. Accepts flexible input types (Record, RecordId, or RecordRef) and resolves to the parent record following the configured "To Table" chain. Useful for navigating upward from detail records to header reco...
- `FindSingleParentRecord(var InFromThisRecordRef: RecordRef; var FoundParentRecordRef: RecordRef): Boolean` (internal): Finds the single parent record for a given child record using source configuration relationships. Searches both "From Table" and "To Table" configurations to locate the parent record. Uses configured filters and field relationships to navigate the record hierarchy. Common use cases: - Navigate from ...
- `FindRelatedItem(var Item: Record Item; TargetRecordRef: RecordRef; Optional2Variant: Variant; Optional3Variant: Variant; Optional4Variant: Variant): Boolean` (internal): Searches for a related Item record by sequentially checking supplied record variants. This is an overload that accepts 4 optional variants and internally calls the 5-variant version. Uses early-exit pattern for improved readability and performance. This procedure enables finding the Item regardless ...
- `FindRelatedItem(var Item: Record Item; TargetRecordRef: RecordRef; Optional2Variant: Variant; Optional3Variant: Variant; Optional4Variant: Variant; Optional5Variant: Variant): Boolean` (internal): Searches for a related Item record by sequentially checking supplied record variants. Uses early-exit pattern for improved readability and performance. This procedure uses a custom search algorithm specific to Item lookups: - Items can be found through "Source Item No." field in Quality Inspections ...
- `FindRelatedItemIn(var Item: Record Item; CurrentVariant: Variant): Boolean` (internal): Searches for a related Item record within a specific record variant using source field configuration. Handles direct Item records and indirect lookups through "Source Item No." field mappings. This is the core lookup implementation used by the FindRelatedItem overloads. Lookup strategy: 1. If Curren...
- `FindRelatedVendor(var Vendor: Record Vendor; Optional1Variant: Variant; Optional2Variant: Variant; Optional3Variant: Variant; Optional4Variant: Variant; Optional5Variant: Variant): Boolean` (internal): Searches for a related Vendor record by sequentially checking supplied record variants. Uses early-exit pattern for improved readability and performance. Search sequence: 1. Check Optional1Variant for Vendor → exit immediately if found 2. Check Optional2Variant for Vendor → exit immediately if found...
- `FindRelatedVendorIn(var Vendor: Record Vendor; CurrentVariant: Variant): Boolean` (internal): Searches for a related Vendor record within a specific record variant using field relationships. Handles direct Vendor records and indirect lookups through field mappings to "Source Vendor No." Lookup strategy: 1. If CurrentVariant is a Vendor record → return it directly 2. Call FindRelatedRecordByF...
- `FindRelatedCustomer(var Customer: Record Customer; Optional1Variant: Variant; Optional2Variant: Variant; Optional3Variant: Variant; Optional4Variant: Variant; Optional5Variant: Variant): Boolean` (internal): Searches for a related Customer record by sequentially checking supplied record variants. Uses early-exit pattern for improved readability and performance. Search sequence: 1. Check Optional1Variant for Customer → exit immediately if found 2. Check Optional2Variant for Customer → exit immediately if...
- `FindRelatedCustomerIn(var Customer: Record Customer; CurrentVariant: Variant): Boolean` (internal): Searches for a related Customer record within a specific record variant using field relationships. Handles direct Customer records and indirect lookups through field mappings to "Source Customer No." Lookup strategy: 1. If CurrentVariant is a Customer record → return it directly 2. Call FindRelatedR...
- `FindRelatedRouting(var RoutingHeader: Record "Routing Header"; Optional1Variant: Variant; Optional2Variant: Variant; Optional3Variant: Variant; Optional4Variant: Variant; Optional5Variant: Variant): Boolean` (internal): Searches for a related Routing Header record by sequentially checking supplied record variants. Uses early-exit pattern for improved readability and performance. Search sequence: 1. Check Optional1Variant for Routing → exit immediately if found 2. Check Optional2Variant for Routing → exit immediatel...
- `FindRelatedRoutingIn(var RoutingHeader: Record "Routing Header"; CurrentVariant: Variant): Boolean` (internal): Searches for a related Routing Header within a specific record variant using field relationships. Handles direct Routing Header records and indirect lookups through field mappings. Lookup strategy: 1. If CurrentVariant is a Routing Header record → return it directly 2. Call FindRelatedRecordByFieldR...
- `FindRelatedBillOfMaterial(var ProductionBOMHeader: Record "Production BOM Header"; Optional1Variant: Variant; Optional2Variant: Variant; Optional3Variant: Variant; Optional4Variant: Variant; Optional5Variant: Variant): Boolean` (internal): Searches for a related Production BOM Header record by sequentially checking supplied record variants. Uses early-exit pattern for improved readability and performance. Search sequence: 1. Check Optional1Variant for BOM → exit immediately if found 2. Check Optional2Variant for BOM → exit immediately...
- `FindRelatedBillOfMaterialIn(var ProductionBOMHeader: Record "Production BOM Header"; CurrentVariant: Variant): Boolean` (internal): Searches for a related Production BOM Header within a specific record variant using field relationships. Handles direct BOM Header records and indirect lookups through both field mappings and table relations. Lookup strategy (more complex than other FindRelated* procedures): 1. If CurrentVariant is ...
- `FindRelatedProdOrderRoutingLine(var ProdOrderRoutingLine: Record "Prod. Order Routing Line"; Optional1Variant: Variant; Optional2Variant: Variant; Optional3Variant: Variant; Optional4Variant: Variant; Optional5Variant: Variant): Boolean` (internal): Searches for a related Production Order Routing Line by sequentially checking supplied record variants. Uses an exact table number match strategy through the GetIfAnExactMatch helper procedure. Unlike other FindRelated* procedures that search through field mappings, this procedure looks for an exact...

Plus 9 local procedures.

## 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 20599 "Qlty. Misc Helpers"](../codeunit/20599.md) (6 calls: `FindRelatedBillOfMaterialIn → GetRecordRefFromVariant`, `FindRelatedCustomerIn → GetRecordRefFromVariant`, `FindRelatedItemIn → GetRecordRefFromVariant`, …)
- [Codeunit 20432 "Qlty. Configuration Helpers"](../codeunit/20432.md) (3 calls: `ApplySourceFields → GetArbitraryMaximumRecursion`, `FindPossibleTargetsBasedOnConfigRecursive → GetArbitraryMaximumRecursion`, `GetSourceFieldInfo → GetArbitraryMaximumRecursion`)

## Called by

- [Codeunit 20404 "Qlty. Inspection - Create"](../codeunit/20404.md) (5 calls: `ApplyAllSourceFieldsToStub → ApplySourceFields`, `CreateInspectionForSelfOrDirectParent → FindRelatedItem`, `CreateInspectionForSelfOrDirectParent → FindSingleParentRecord`, …)
- [Table 20405 "Qlty. Inspection Header"](../table/20405.md) (5 calls: `DetermineControlInformation → DetermineControlInformation`, `GetControlCaptionClass → GetControlCaptionClass`, `GetControlVisibleState → GetControlVisibleState`, …)
- [Codeunit 20405 "Qlty. Inspec. Gen. Rule Mgmt."](../codeunit/20405.md) (3 calls: `FindFirstGenerationRuleAndRecordBasedOnRecursive → FindFromTableLinkedRecordWithToTable`, `FindMatchingGenerationRule → FindPossibleTargetsBasedOnConfigRecursive`, `SetFilterToApplicableTemplates → FindPossibleTargetsBasedOnConfigRecursive`)
- [Codeunit 20407 "Qlty. Manufactur. Integration"](../codeunit/20407.md) (3 calls: `UpdateSourceDocumentForSpecificInspectionOnLine → ApplySourceFields`, `UpdateSourceDocumentForSpecificInspectionOnOperation → ApplySourceFields`, `UpdateSourceDocumentForSpecificInspectionOnOrder → ApplySourceFields`)
- [Report 20400 "Qlty. Create Inspection"](../report/20400.md) (1 call: `AssistEditChooseRecord → ApplySourceFields`)

## Recent changes

- 2026-08-20 [#10270 [Quality Management] Repair and improve XML documentation of procedures](../../changes/bcapps/10270.md) (main, BC30, refactor)
- 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: none

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: "codeunit", object_name: "Qlty. Traversal")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
