Skip to content

Migrate obsoleted "Object Name" field to "Name" and fix silent truncation#9312

Draft
SBalslev wants to merge 1 commit into
mainfrom
sbalslev-friendly-couscous
Draft

Migrate obsoleted "Object Name" field to "Name" and fix silent truncation#9312
SBalslev wants to merge 1 commit into
mainfrom
sbalslev-friendly-couscous

Conversation

@SBalslev

@SBalslev SBalslev commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Important

BLOCKED — do not merge yet. This PR migrates references from the obsoleted "Object Name" field to the new Name field on the platform virtual tables AllObj (2000000038), AllObjWithCaption (2000000058), and System Object (2000000029).

CI currently fails all app builds with AL0132 / AL0186 'Name' does not exist because the new Name field has not yet shipped into the platform symbols/artifacts that BCApps compiles against. It exists only in the platform source branch.

This PR can only go green once the platform change adding the Name field is released into the BCApps build artifacts. The migration code itself is correct — the missing-field errors are the only compile failures. Parked as draft until the platform dependency lands.


What & why

The "Object Name" field (Text[30]) on the system virtual tables AllObj (2000000038), AllObjWithCaption (2000000058), and System Object (2000000029) was obsoleted on the platform and replaced by a new Name field (Text[100]). This PR migrates every reference in BCApps and eliminates the silent truncation the widened type would otherwise cause.

  • Migrate references — all "Object Name" usages on these three tables to Name (144 files).
  • Widen persisted fields / FlowFields that receive object names to Text[100] (non-breaking): ObjectTranslation, ExportProtocol, CALTestResult, ChangeGlobalDimLogEntry, GenericChartSetup, TaxEntity, EntityAttributeMapping, MigrationTableMapping.
  • Widen byref (var) parameter chains and their callers to Text[100] — AL requires byref arguments to match the parameter type exactly (including length), so Text[100] cannot flow into var Text. Affects the INTaxEngine object/table lookup cascade (AppObjectHelper, TaxTypeObjectHelper), GenericChartMgt, and the ScriptSymbolLookupDialog publishers and TaxTypeObjectHelper subscribers.
  • Fix a JSON round-trip regression — import read object names via JToken2Text30 (truncating to 30) before an exact-match lookup; switched the object-name sites to the unbounded JToken2Text so long names resolve.

Convention applied: by-value params & return values to unbounded Text; persisted table fields & FlowFields to Text[100]; byref params and everything passed into them to Text[100]. Increasing an AL text length is non-breaking (only shortening needs a data upgrade).

Linked work

Fixes #

An approved issue still needs to be linked here before merge.

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • Behavior is covered by existing tests (INTaxEngine AppObjectHelperTests / TaxTypeObjectHelperTests, test-runner suites); no new tests added since this is a field rename + width-safety change.

What I tested and the outcome

  • Audited every sink where a Name value flows: all := <table>.Name assignments land in unbounded Text, Text[100], or Text[128]; all exit(...Name) return sites return unbounded Text / Text[256].
  • Verified integration event publisher/subscriber signatures still match after widening.
  • Not yet built locally — this environment can't compile AL. Relying on CI here to confirm the build; happy to iterate on any analyzer/compile findings.

Risk & compatibility

  • All schema changes are field-length increases (Text[30] to Text[100]), which are non-breaking and need no data upgrade.
  • No behavioral changes beyond removing truncation of names longer than 30 characters.
  • Obsoleted-field references on the three virtual tables are fully removed; same-named "Object Name" fields on unrelated tables (Tenant Permission, Metadata Permission, Expanded Permission, Application Object Metadata) are intentionally untouched.

…tion

The "Object Name" field (Text[30]) on system virtual tables AllObj (2000000038),
AllObjWithCaption (2000000058), and System Object (2000000029) was obsoleted and
replaced by a new "Name" field (Text[100]).

- Migrate all references from "Object Name" to Name across the repo.
- Widen persisted fields/FlowFields that receive object names to Text[100]
  (non-breaking): ObjectTranslation, ExportProtocol, CALTestResult,
  ChangeGlobalDimLogEntry, GenericChartSetup, TaxEntity, EntityAttributeMapping,
  MigrationTableMapping.
- Widen byref (var) parameter chains and their callers to Text[100] to preserve
  AL's exact-type matching (INTaxEngine object/table lookups, GenericChartMgt,
  ScriptSymbolLookupDialog publishers and TaxTypeObjectHelper subscribers).
- Fix JSON round-trip: read object names with unbounded JToken2Text instead of
  JToken2Text30 to avoid truncating names before exact-match lookups.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Could not find a linked ADO work item. Please link one by using the pattern 'AB#' followed by the relevant work item number. You may use the 'Fixes' keyword to automatically resolve the work item when the pull request is merged. E.g. 'Fixes AB#1234'

@@ -28,7 +28,7 @@ tableextension 6374 "Transformation Rule" extends "Transformation Rule"
}
field(6371; "Lookup Table Name"; Text[30])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that the PR is now only draft, but I was just wanted to confirm:
will those field length be updated to the new length (This is how I understood the PR description)?

Do we need obsoletion process like it was done for the home page field in the Base App?
That would require 3 Releases and the CalcForumula couldn't be changed right now.

Or will the platform ignore overflow of Lookups?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants