Skip to content

Fix error when selecting item as the line type in German language - #9937

Open
Ceshark (6CRIPT) wants to merge 8 commits into
mainfrom
bugs/644921-error-when-selecting-the-line-type-item-in-German
Open

Fix error when selecting item as the line type in German language #9937
Ceshark (6CRIPT) wants to merge 8 commits into
mainfrom
bugs/644921-error-when-selecting-the-line-type-item-in-German

Conversation

@6CRIPT

@6CRIPT Ceshark (6CRIPT) commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Fixes AB#644921

Needs a backport to 28.x to fix original WI.

@6CRIPT
Ceshark (6CRIPT) requested a review from a team August 4, 2026 06:58
@6CRIPT Ceshark (6CRIPT) self-assigned this Aug 4, 2026
@github-actions github-actions Bot added the Integration GitHub request for Integration area label Aug 4, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Aug 4, 2026
@6CRIPT Ceshark (6CRIPT) added the SCM GitHub request for SCM area label Aug 4, 2026
@github-actions github-actions Bot removed the SCM GitHub request for SCM area label Aug 4, 2026
Comment thread src/Layers/W1/BaseApp/Utilities/OptionLookupBuffer.Table.al
Comment thread src/Layers/W1/BaseApp/Utilities/OptionLookupBuffer.Table.al
@6CRIPT Ceshark (6CRIPT) added the SCM GitHub request for SCM area label Aug 4, 2026
@github-actions github-actions Bot removed the SCM GitHub request for SCM area label Aug 4, 2026
Comment thread src/Layers/W1/BaseApp/Utilities/OptionLookupBuffer.Table.al Outdated
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Agentic PR Review - Round 1

Recommendation: Request Changes

What this PR does

This PR changes Option Lookup Buffer to remember the current line type by ID instead of by caption. That is the right direction for translated line type captions, and the W1 and CH changes stay aligned.

The fix does not cover the full Blanket Sales Order path from the bug. After the lookup validates the new type, BlanketSalesOrderSubform.UpdateTypeText() still calls Rec.FormatType(), and Sales Line.FormatType() returns Text[20]. The German caption for Charge (Item) is longer than that, so selecting the value or opening an existing line can still hit the same string length error.

Suggestions

S1 - Fix the remaining Blanket Sales Order text path
Align BlanketSalesOrderSubform.UpdateTypeText() with the other sales subforms and avoid Rec.FormatType() for the visible subtype text. The current path still goes through Sales Line.FormatType(): Text[20], so the German Charge (Item) caption can still fail after this change.

S2 - Add a German regression test
Add a test that sets German language, uses a Blanket Sales Order line, and selects or displays Charge (Item). This is feasible with the existing test page and language patterns, and it would prove that both the selection and existing-line display paths no longer throw the string length error.

Risk assessment and necessity

Risk: The changed table is used by sales and purchase subtype fields, so a wrong fallback can affect many document pages. The immediate risk is still focused on line type display and validation, not posting amounts or public event contracts. There is no BaseApp publisher dependency in this PR.

Necessity: The bug is valid and important: German users cannot select Charge (Item) on Blanket Sales Orders, and the work item says there is no workaround. The change is necessary, but the current scope misses one execution path that is part of the reported scenario.


[AI-PR-REVIEW] version=1 system=github pr=9937 round=1 by=alexei-dobriansky at=2026-08-04T14:03:25Z lastSha=b43083eeb2cf4100abefb9d1f501632d9b469764 suggestions=S1,S2

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

⚠️ Stale Status Check Deleted

The Pull Request Build workflow run for this PR was older than 72 hours and has been deleted.

📋 Why was it deleted?

Status checks that are too old may no longer reflect the current state of the target branch. To ensure this PR is validated against the latest code and passes up-to-date checks, a fresh build is required.


🔄 How to trigger a new status check:

  1. 📤 Push a new commit to the PR branch, or
  2. 🔁 Close and reopen the PR

This will automatically trigger a new Pull Request Build workflow run.

Comment thread src/Layers/CH/BaseApp/Utilities/OptionLookupBuffer.Table.al Outdated
Comment thread src/Layers/W1/BaseApp/Utilities/OptionLookupBuffer.Table.al Outdated
Comment thread src/Layers/CH/BaseApp/Utilities/OptionLookupBuffer.Table.al Outdated
Comment thread src/Layers/W1/BaseApp/Utilities/OptionLookupBuffer.Table.al Outdated
@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Agentic PR Review - Round 2

Recommendation: Accept

What this PR does

This update fixes the remaining Blanket Sales Order display path for long translated line type captions. UpdateTypeText() now uses Option Lookup Buffer.FormatOption() in W1, CH, NA, and NO, so the visible type text no longer goes through the Text[20] result from Sales Line.FormatType().

The change addresses the reported German Charge (Item) scenario and aligns Blanket Sales Orders with the other sales document subforms that already use the option lookup buffer for this field. The added W1 and CH tests select the German caption on a Blanket Sales Order line and verify that the full caption stays visible.

Status of previous suggestions
ID Title Status Author response
S1 Fix the remaining Blanket Sales Order text path Addressed UpdateTypeText() now uses TempOptionLookupBuffer.FormatOption(...) instead of Rec.FormatType() in the changed layers.
S2 Add a German regression test Addressed W1 and CH now include a German Blanket Sales Order regression test for the long Charge (Item) caption.
New observations (commits since round 1)

None - changes only addressed the previous suggestions.

Risk assessment and necessity

Risk: The changed path is the Basic/Suite display and validation helper for the sales line type on Blanket Sales Orders in W1, CH, NA, and NO. It does not change posting, amounts, ledger data, or public signatures. It does switch this page from the Sales Line.FormatType() formatting event path to the option lookup buffer formatting path for non-blank types, but that matches the other sales document subforms.

Necessity: The bug is valid and important because the German Charge (Item) caption is longer than 20 characters and blocked Blanket Sales Order line entry. The scope is narrow and now covers both the remaining display path and a direct regression test for the reported workflow.


[AI-PR-REVIEW] version=1 promptVersion=2 system=github pr=9937 round=2 by=alexei-dobriansky at=2026-08-12T08:11:44Z lastSha=a169be51a33b7756bc304b45e9f707a41bc0efb1 reviewKey=3e5f7d46ce2553eece4d905755b2ed3ebf694522a5ede1ef01c7d22ff9c2b212 suggestions=S1@5f83e07f:addressed,S2@3d1014ac:addressed parentRound=1

Comment thread src/Layers/W1/Tests/Misc/OptionLookupBufferTest.Codeunit.al Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ownership: Manual Preserve the manually selected team ownership SCM GitHub request for SCM area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants