---
id: change/bcapps/13428
type: change
title: "#13428 [Quality Management] Keep Sample Size and Pass/Fail Quantity within Quantity (Base)"
summary: Quality Management inspections now enforce that Sample Size and Pass/Fail Quantity cannot exceed Quantity (Base), preventing data inconsistencies when Quantity (Base) is reduced after inspection creation or when it is zero.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - table qlty. inspection template hdr.
  - table qlty. inspection header
system: inventory
review:
  state: reviewed
  by: opus
  at: "2026-11-07T01:03:56.773Z"
  flags: []
generated:
  at: "2026-11-13T00:13:31.718Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 017d3d02cb47724510788b245246428b37c2b555
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/13428
    title: "microsoft/BCApps#13428: [Quality Management] Keep Sample Size and Pass/Fail Quantity within Quantity (Base)"
    date: "2026-11-06"
    commit: 017d3d02cb47724510788b245246428b37c2b555
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/table/20402
    - object/table/20405
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/qms-quality-templates
      title: Create quality inspection templates
      label: possibly related
      why: Documents quality inspection templates defining measurements and test attributes.
      by: model
number: 13428
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/13428
kind: pr
base_branch: main
major: "30"
merged_at: "2026-11-06T17:08:28Z"
author: alexei-dobriansky
author_type: User
community_contribution: false
labels:
  - "AL: Apps (W1)"
  - "Team: SCM"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 4
  additions: 106
  deletions: 6
  al: 2
apps:
  - Quality Management
objects_touched:
  - key: table/20402
    page: table/20402
    type: table
    id: 20402
    name: Qlty. Inspection Template Hdr.
    app: Quality Management
    status: modified
  - key: table/20405
    page: table/20405
    type: table
    id: 20405
    name: Qlty. Inspection Header
    app: Quality Management
    status: modified
objects_unjoined: []
obsoletions: []
backports:
  - number: 13797
    base: releases/29.x
    url: https://github.com/microsoft/BCApps/pull/13797
fixes_issues: []
work_items:
  - 655845
  - 655846
systems:
  - inventory
quote: null
joined_against:
  major: "30"
  commit: d2abc1d2ceae394331716c8183ef60e1534c2ce0
---

# #13428 [Quality Management] Keep Sample Size and Pass/Fail Quantity within Quantity (Base)

> Quality Management inspections now enforce that Sample Size and Pass/Fail Quantity cannot exceed Quantity (Base), preventing data inconsistencies when Quantity (Base) is reduced after inspection creation or when it is zero.

[Pull request](https://github.com/microsoft/BCApps/pull/13428) · merged into `main` (BC30) on 2026-11-06 by alexei-dobriansky · 4 files (+106 -6), 2 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Sample Size and template Sample Fixed Amount now have MinValue = 0; a negative fixed amount already on a template is treated as 0 so posting is not blocked
- Validating Quantity (Base) re-caps a Sample Size that exceeds it
- On Finish the applied quantity is Sample Size if above 0, otherwise Quantity (Base), always capped at Quantity (Base), with no silent early exit
- Inspections with Quantity (Base) = 0 now finish with Pass/Fail 0 instead of the sample size
- Pass/Fail Quantity tooltips state the cap; existing negative Sample Size values are not migrated
- Behaviour changes for users or extensions.

## AL objects touched

- [Table 20402 "Qlty. Inspection Template Hdr."](../../objects/table/20402.md), Quality Management: modified
- [Table 20405 "Qlty. Inspection Header"](../../objects/table/20405.md), Quality Management: modified

## Also merged into

- [#13797](https://github.com/microsoft/BCApps/pull/13797) into `releases/29.x` on 2026-11-12

## Context

- Work items: AB#655845, AB#655846
- Labels: AL: Apps (W1), Team: SCM
- Systems: inventory

## Possibly related

No source states these links: they share an object, a model read them, or a person found the same subject.

- [Create quality inspection templates](https://learn.microsoft.com/dynamics365/business-central/qms-quality-templates) — possibly related: Documents quality inspection templates defining measurements and test attributes. (model-linked)

Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
