---
id: change/bcquality/125
type: change
title: "#125 knowledge(data-modeling): TableRelation delete/rename asymmetry and the xRec before-image contract"
summary: "Adds three community data-modeling knowledge articles, each with good and bad AL examples: owning tables must delete dependents in OnDelete, ValidateTableRelation = false also stops rename propagation, and xRec is a true before-image only in some triggers."
tier: official
language: en
tags:
  - other
  - main
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:09:59.398Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: a58b23d0f905740a1464ef908bc36921c26f1fad
evidence:
  - kind: code
    url: https://github.com/microsoft/BCQuality/pull/125
    title: "microsoft/BCQuality#125: knowledge(data-modeling): TableRelation delete/rename asymmetry and the xRec before-image contract"
    date: "2026-08-10"
    commit: a58b23d0f905740a1464ef908bc36921c26f1fad
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 125
repo: microsoft/BCQuality
source_id: bcquality-prs
url: https://github.com/microsoft/BCQuality/pull/125
kind: pr
base_branch: main
major: null
merged_at: "2026-08-10T11:11:38Z"
author: StefanMaron
author_type: User
community_contribution: false
labels: []
change_class: code
change_kind: other
behavior_change: false
breaking: false
files:
  count: 9
  additions: 412
  deletions: 0
  al: 9
apps: []
objects_touched: []
objects_unjoined:
  - path: community/knowledge/data-modeling/owning-table-must-delete-dependents-in-ondelete.bad.al
    status: added
    reason: not-in-snapshot
  - path: community/knowledge/data-modeling/owning-table-must-delete-dependents-in-ondelete.good.al
    status: added
    reason: not-in-snapshot
  - path: community/knowledge/data-modeling/owning-table-must-delete-dependents-in-ondelete.md
    status: added
    reason: not-in-snapshot
  - path: community/knowledge/data-modeling/validate-table-relation-false-suppresses-rename-propagation.bad.al
    status: added
    reason: not-in-snapshot
  - path: community/knowledge/data-modeling/validate-table-relation-false-suppresses-rename-propagation.good.al
    status: added
    reason: not-in-snapshot
  - path: community/knowledge/data-modeling/validate-table-relation-false-suppresses-rename-propagation.md
    status: added
    reason: not-in-snapshot
  - path: community/knowledge/data-modeling/xrec-is-a-before-image-only-in-some-triggers.bad.al
    status: added
    reason: not-in-snapshot
  - path: community/knowledge/data-modeling/xrec-is-a-before-image-only-in-some-triggers.good.al
    status: added
    reason: not-in-snapshot
  - path: community/knowledge/data-modeling/xrec-is-a-before-image-only-in-some-triggers.md
    status: added
    reason: not-in-snapshot
obsoletions: []
backports: []
fixes_issues: []
work_items: []
systems:
  - development
quote: null
joined_against:
  major: null
  commit: null
---

# #125 knowledge(data-modeling): TableRelation delete/rename asymmetry and the xRec before-image contract

> Adds three community data-modeling knowledge articles, each with good and bad AL examples: owning tables must delete dependents in OnDelete, ValidateTableRelation = false also stops rename propagation, and xRec is a true before-image only in some triggers.

[Pull request](https://github.com/microsoft/BCQuality/pull/125) · merged into `main` on 2026-08-10 by StefanMaron · 9 files (+412 -0), 9 AL · other · tier official · reviewed (checked by Opus)

## What changed

- Owning tables must delete dependent records manually since AL lacks cascading delete, and delete permissions are required on dependent tables
- Setting ValidateTableRelation to false suppresses rename propagation, not just input validation
- xRec is a true before-image only in OnRename and OnDelete, or in OnInsert/OnModify when triggered from a page, but reflects current Rec when those triggers fire from code

## AL objects touched

- `community/knowledge/data-modeling/owning-table-must-delete-dependents-in-ondelete.bad.al`: added, not in the BC? snapshot yet
- `community/knowledge/data-modeling/owning-table-must-delete-dependents-in-ondelete.good.al`: added, not in the BC? snapshot yet
- `community/knowledge/data-modeling/owning-table-must-delete-dependents-in-ondelete.md`: added, not in the BC? snapshot yet
- `community/knowledge/data-modeling/validate-table-relation-false-suppresses-rename-propagation.bad.al`: added, not in the BC? snapshot yet
- `community/knowledge/data-modeling/validate-table-relation-false-suppresses-rename-propagation.good.al`: added, not in the BC? snapshot yet
- `community/knowledge/data-modeling/validate-table-relation-false-suppresses-rename-propagation.md`: added, not in the BC? snapshot yet
- `community/knowledge/data-modeling/xrec-is-a-before-image-only-in-some-triggers.bad.al`: added, not in the BC? snapshot yet
- `community/knowledge/data-modeling/xrec-is-a-before-image-only-in-some-triggers.good.al`: added, not in the BC? snapshot yet
- `community/knowledge/data-modeling/xrec-is-a-before-image-only-in-some-triggers.md`: added, not in the BC? snapshot yet

## 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).
