---
id: change/bcquality/208
type: change
title: "#208 2 AL/BC patterns: TableRelation field length and RecordRef.Open Temp parameter"
summary: Two new knowledge articles identify silent runtime mismatches in table relations and record reference calls that compile without diagnostic warnings. The articles explain the exact rules for field length matching and the pitfalls of using RecordRef.Open with the temporary parameter flag.
tier: official
language: en
tags:
  - feature
  - main
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:02:06.528Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 018e62767dd41bccfc94cbfa0a12ff25ec64792c
evidence:
  - kind: code
    url: https://github.com/microsoft/BCQuality/pull/208
    title: "microsoft/BCQuality#208: 2 AL/BC patterns: TableRelation field length and RecordRef.Open Temp parameter"
    date: "2026-10-06"
    commit: 018e62767dd41bccfc94cbfa0a12ff25ec64792c
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 208
repo: microsoft/BCQuality
source_id: bcquality-prs
url: https://github.com/microsoft/BCQuality/pull/208
kind: pr
base_branch: main
major: null
merged_at: "2026-10-06T11:30:38Z"
author: MichaelDieringer
author_type: User
community_contribution: false
labels: []
change_class: code
change_kind: feature
behavior_change: false
breaking: false
files:
  count: 9
  additions: 267
  deletions: 6
  al: 8
apps: []
objects_touched: []
objects_unjoined:
  - path: microsoft/knowledge/data-modeling/tablerelation-field-length-must-match-related-field.bad.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/data-modeling/tablerelation-field-length-must-match-related-field.good.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/data-modeling/tablerelation-field-length-must-match-related-field.md
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/testing/recordref-open-temp-parameter-defeats-real-table-checks.bad.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/testing/recordref-open-temp-parameter-defeats-real-table-checks.good.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/testing/recordref-open-temp-parameter-defeats-real-table-checks.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-testing-review.md
    status: modified
    reason: not-in-snapshot
obsoletions: []
backports: []
fixes_issues: []
work_items: []
systems:
  - development
  - platform
quote: null
joined_against:
  major: null
  commit: null
---

# #208 2 AL/BC patterns: TableRelation field length and RecordRef.Open Temp parameter

> Two new knowledge articles identify silent runtime mismatches in table relations and record reference calls that compile without diagnostic warnings. The articles explain the exact rules for field length matching and the pitfalls of using RecordRef.Open with the temporary parameter flag.

[Pull request](https://github.com/microsoft/BCQuality/pull/208) · merged into `main` on 2026-10-06 by MichaelDieringer · 9 files (+267 -6), 8 AL · feature · tier official · reviewed (checked by Opus)

## What changed

- Table relation fields shorter than their target compile cleanly but fail at runtime when longer values are assigned
- Mixed Code/Text targets require Text type and minimum length rules vary by relation type
- RecordRef.Open with Temp=true creates empty instances that bypass existence and uniqueness checks
- Legitimate temporary uses include validation sandboxes and filter parsing
- Knowledge base extended with guidance to help developers avoid these common mistakes

## AL objects touched

- `microsoft/knowledge/data-modeling/tablerelation-field-length-must-match-related-field.bad.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/data-modeling/tablerelation-field-length-must-match-related-field.good.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/data-modeling/tablerelation-field-length-must-match-related-field.md`: added, not in the BC? snapshot yet
- `microsoft/knowledge/testing/recordref-open-temp-parameter-defeats-real-table-checks.bad.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/testing/recordref-open-temp-parameter-defeats-real-table-checks.good.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/testing/recordref-open-temp-parameter-defeats-real-table-checks.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-testing-review.md`: modified, not in the BC? snapshot

## Context

- Systems: development, platform

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