---
id: change/bcquality/209
type: change
title: "#209 3 AL/BC patterns: Insert/Delete trigger defaults on master data and declined Confirm in OnValidate"
summary: Three new articles guide developers to use triggers when writing or deleting master data and to properly abort validations when user confirmation is declined.
tier: official
language: en
tags:
  - feature
  - main
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:03:02.004Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 462765e414986b0bd83996d8b8d788495944230c
evidence:
  - kind: code
    url: https://github.com/microsoft/BCQuality/pull/209
    title: "microsoft/BCQuality#209: 3 AL/BC patterns: Insert/Delete trigger defaults on master data and declined Confirm in OnValidate"
    date: "2026-10-05"
    commit: 462765e414986b0bd83996d8b8d788495944230c
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 209
repo: microsoft/BCQuality
source_id: bcquality-prs
url: https://github.com/microsoft/BCQuality/pull/209
kind: pr
base_branch: main
major: null
merged_at: "2026-10-05T12:46:27Z"
author: MichaelDieringer
author_type: User
community_contribution: false
labels: []
change_class: code
change_kind: feature
behavior_change: false
breaking: false
files:
  count: 12
  additions: 289
  deletions: 4
  al: 11
apps: []
objects_touched: []
objects_unjoined:
  - path: microsoft/knowledge/data-modeling/delete-master-data-with-trigger.bad.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/data-modeling/delete-master-data-with-trigger.good.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/data-modeling/delete-master-data-with-trigger.md
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/data-modeling/master-data-must-be-inserted-with-trigger.bad.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/data-modeling/master-data-must-be-inserted-with-trigger.good.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/data-modeling/master-data-must-be-inserted-with-trigger.md
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/error-handling/declined-confirm-must-abort-not-partially-apply.bad.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/error-handling/declined-confirm-must-abort-not-partially-apply.good.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/error-handling/declined-confirm-must-abort-not-partially-apply.md
    status: added
    reason: not-in-snapshot
  - path: microsoft/skills/review/al-data-modeling-review.md
    status: modified
    reason: not-in-snapshot
  - path: microsoft/skills/review/al-error-handling-review.md
    status: modified
    reason: not-in-snapshot
obsoletions: []
backports: []
fixes_issues: []
work_items: []
systems:
  - development
quote: null
joined_against:
  major: null
  commit: null
---

# #209 3 AL/BC patterns: Insert/Delete trigger defaults on master data and declined Confirm in OnValidate

> Three new articles guide developers to use triggers when writing or deleting master data and to properly abort validations when user confirmation is declined.

[Pull request](https://github.com/microsoft/BCQuality/pull/209) · merged into `main` on 2026-10-05 by MichaelDieringer · 12 files (+289 -4), 11 AL · feature · tier official · reviewed (checked by Opus)

## What changed

- Record.Insert() and Delete() skip OnInsert and OnDelete by default; use Insert(true) and Delete(true) for master tables
- Declined Confirm in OnValidate commits the new value; use Error to abort or restore xRec instead
- Articles cite exceptions: temporary records, XMLports, data migration rebuilds, and cascade deletes within the owning table
- Review skills updated with targeted checks and documented exclusions
- All fixtures verified to compile and all BCApps citations re-opened at main

## AL objects touched

- `microsoft/knowledge/data-modeling/delete-master-data-with-trigger.bad.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/data-modeling/delete-master-data-with-trigger.good.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/data-modeling/delete-master-data-with-trigger.md`: added, not in the BC? snapshot yet
- `microsoft/knowledge/data-modeling/master-data-must-be-inserted-with-trigger.bad.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/data-modeling/master-data-must-be-inserted-with-trigger.good.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/data-modeling/master-data-must-be-inserted-with-trigger.md`: added, not in the BC? snapshot yet
- `microsoft/knowledge/error-handling/declined-confirm-must-abort-not-partially-apply.bad.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/error-handling/declined-confirm-must-abort-not-partially-apply.good.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/error-handling/declined-confirm-must-abort-not-partially-apply.md`: added, not in the BC? snapshot yet
- `microsoft/skills/review/al-data-modeling-review.md`: modified, not in the BC? snapshot
- `microsoft/skills/review/al-error-handling-review.md`: modified, not in the BC? snapshot

## Context

- Systems: development

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