Skip to content

[Master][ALL-E] No Reservation created when the item is selected by Description in Sales Lines#9653

Draft
sanjmaurya wants to merge 5 commits into
mainfrom
bugs/Bug-643213-Main-ReservationCreatedWhenItemISelected-byDescription
Draft

[Master][ALL-E] No Reservation created when the item is selected by Description in Sales Lines#9653
sanjmaurya wants to merge 5 commits into
mainfrom
bugs/Bug-643213-Main-ReservationCreatedWhenItemISelected-byDescription

Conversation

@sanjmaurya

@sanjmaurya sanjmaurya commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Bug 643213: [Master][ALL-E] No Reservation created when the item is selected by Description in Sales Lines

Fixes AB#6493213

Issue :- No Reservation created when the item is selected by Description in Sales Lines

Cause :- Reserve = Always items, the automatic reservation in NoOnAfterValidate (SalesOrderSubform.Page.al) is gated by (Rec."Outstanding Qty. (Base)" <> 0) and (Rec."No." <> xRec."No."). That guard is evaluated after a CurrPage.SaveRecord() call.

Manual description entry: "No." is resolved inside the field's OnValidate, xRec."No." stays blank, so the guard holds → reservation created. (Already working after the CurrFieldNo edits.)
Description lookup (dropdown): "No." is set earlier in OnAfterLookup → SaveLookupSelection. By the time the inner CurrPage.SaveRecord() runs, xRec re-syncs to the saved record, so Rec."No." <> xRec."No." flips to false and AutoReserve() is skipped.

Solutions :- n NoOnAfterValidate, capture whether "No." changed into a local NoHasChanged before any CurrPage.SaveRecord() runs, and use that captured value in the reservation guard. This preserves the working manual path (value stays true) and fixes the lookup path.

Two files now carry the fix:

SalesLine.Table.al — CurrFieldNo := FieldNo("No.") set at the three points where Description resolves to an item No. (exact/similar match branches, SaveLookupSelection, RestoreLookupSelection), matching the Purchase Line pattern.
SalesOrderSubform.Page.al — capture NoHasChanged before SaveRecord and use it in the AutoReserve guard.

@github-actions github-actions Bot added the SCM GitHub request for SCM area label Jul 22, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

SCM GitHub request for SCM area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant