---
id: object/codeunit/20445
type: object
title: Codeunit 20445 "Qlty. Inventory Availability"
summary: Codeunit 20445 "Qlty. Inventory Availability" in Quality Management (Microsoft.QualityManagement.Integration.Inventory). 5 public procedures, 2 events. 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: 7241f177e18c42685a5fd44166a354972dfa2638e860dd3c62d79d8822f06a1d
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/Quality%20Management/app/src/Integration/Inventory/QltyInventoryAvailability.Codeunit.al
    title: src/Apps/W1/Quality Management/app/src/Integration/Inventory/QltyInventoryAvailability.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/9168
object_type: codeunit
object_id: 20445
name: Qlty. Inventory Availability
namespace: Microsoft.QualityManagement.Integration.Inventory
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: 15
  events: 2
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 1
  called_by: 7
  implements: 0
---

# Codeunit 20445 "Qlty. Inventory Availability"

> Codeunit 20445 "Qlty. Inventory Availability" in Quality Management (Microsoft.QualityManagement.Integration.Inventory). 5 public procedures, 2 events. Introduced in BC29, still in BC30.

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

## Events published

- `OnBeforePopulateBinContentBuffer(var QltyInspectionHeader: Record "Qlty. Inspection Header"; var TempInstructionQltyDispositionBuffer: Record "Qlty. Disposition Buffer" temporary; var TempQuantityQltyDispositionBuffer: Record "Qlty. Disposition Buffer" temporary; var TempExistingInventoryBinContent: Record "Bin Content" temporary; var IsHandled: Boolean)` (integration): Notifies subscribers before disposition quantities are allocated to inventory locations and bins.
- `OnAfterPopulateBinContentBuffer(var QltyInspectionHeader: Record "Qlty. Inspection Header"; var TempInstructionQltyDispositionBuffer: Record "Qlty. Disposition Buffer" temporary; var TempQuantityQltyDispositionBuffer: Record "Qlty. Disposition Buffer" temporary; var TempExistingInventoryBinContent: Record "Bin Content" temporary)` (integration): Notifies subscribers after disposition quantities are allocated to inventory locations and bins.

## Procedures

- `GetCurrentLocationOfTrackedInventory(QltyInspectionHeader: Record "Qlty. Inspection Header"; var TempBinContent: Record "Bin Content" temporary): Boolean` (internal): Finds locations and bins containing positive inventory for the item-tracking values on an inspection. If multiple locations/bins are determined then those multiple locations/bins are supplied in TempBinContent.
- `GetFromDetailsFromInspectionSource(QltyInspectionHeader: Record "Qlty. Inspection Header"; var TempToMoveBinContent: Record "Bin Content" temporary)` (internal): Resolves source locations, bins, and quantities from the inspection's related records into a temporary buffer.
- `GetPassOrFailSamplesCount(var QltyInspectionHeader: Record "Qlty. Inspection Header"; QltyQuantityBehavior: Enum "Qlty. Quantity Behavior"): Decimal` (internal): Gets the inspection's passed or failed sample quantity and rejects nonpositive results. This can exceed the sample size to allow for oversampling. Pass Conditions: the samples must have passed all sampling test measurements Fail Conditions: One or more fail results for a sample designates it as fail...
- `PopulateQuantityBuffer(var QltyInspectionHeader: Record "Qlty. Inspection Header"; var TempInstructionQltyDispositionBuffer: Record "Qlty. Disposition Buffer" temporary; var TempQuantityQltyDispositionBuffer: Record "Qlty. Disposition Buffer" temporary)` (internal): Allocates the disposition quantity across eligible inventory locations and bins.
- `ErrorIfFromBinIsReceiveBin(QltyInspectionHeader: Record "Qlty. Inspection Header"; FromLocationCode: Code[10]; FromBinCode: Code[20])` (internal): Raises an error if the inventory would be moved from a receiving bin, which is not allowed in directed put-away and pick locations until the items have been put away.

Plus 8 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 20439 "Qlty. Item Tracking Mgmt."](../codeunit/20439.md) (1 call: `GetFromLocationAndBinBasedOnNamingConventions → GetItemTrackingCode`)

## Called by

- [Codeunit 20442 "Qlty. Disp. Move Auto Choose"](../codeunit/20442.md) (2 calls: `PerformDisposition → ErrorIfFromBinIsReceiveBin`, `PerformDisposition → PopulateQuantityBuffer`)
- [Codeunit 20451 "Qlty. Disp. Move Worksheet"](../codeunit/20451.md) (2 calls: `PerformDisposition → ErrorIfFromBinIsReceiveBin`, `PerformDisposition → PopulateQuantityBuffer`)
- [Codeunit 20424 "Qlty. Workflow Response"](../codeunit/20424.md) (1 call: `HandleOnExecuteWorkflowResponse → PopulateQuantityBuffer`)
- [Codeunit 20443 "Qlty. Disp. Change Tracking"](../codeunit/20443.md) (1 call: `PerformDisposition → PopulateQuantityBuffer`)
- [Codeunit 20449 "Qlty. Disp. Move Whse.Reclass."](../codeunit/20449.md) (1 call: `PerformDisposition → PopulateQuantityBuffer`)
- [Codeunit 20450 "Qlty. Disp. Internal Move"](../codeunit/20450.md) (1 call: `PerformDisposition → PopulateQuantityBuffer`)
- [Codeunit 20452 "Qlty. Disp. Move Item Reclass."](../codeunit/20452.md) (1 call: `PerformDisposition → PopulateQuantityBuffer`)

## Recent changes

- 2026-08-20 [#10270 [Quality Management] Repair and improve XML documentation of procedures](../../changes/bcapps/10270.md) (main, BC30, refactor)
- 2026-07-15 [#9168 [QM] Fix internal put-away from Quality Inspection sourcing wrong bin](../../changes/bcapps/9168.md) (main, BC30, fix)

## 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. Inventory Availability")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
