[Main] Item tracking validation when lot numbers are assigned concerns the warehouse pick level rather than at the sales order levelInitial Commit - #9982
Conversation
Co-authored-by: Shikhverma <241284522+Shikhverma@users.noreply.github.com>
|
Copilot resolve the merge conflicts in this pull request |
…r-ItemTrackingValidationWhenLotNumbersAreAssigned Co-authored-by: Shikhverma <241284522+Shikhverma@users.noreply.github.com>
Resolved by merging |
…gisteredWhsePickAllocation test Co-authored-by: Shikhverma <241284522+Shikhverma@users.noreply.github.com>
…Bug-638344-Master-ItemTrackingValidationWhenLotNumbersAreAssigned
|
AddSelectedTrackingToDataSet drives its main loop over TempEntrySummary with FindFirst() instead of FindSet() before calling Next() in a repeat/until. Even on a temporary table this pattern is the wrong API for multi-row iteration and should use FindSet(). Suggested fix (apply manually — could not be anchored as a one-click suggestion): if TempEntrySummary.FindSet() then
repeat
TempTrackingSpecification.SetTrackingFilterFromEntrySummary(TempEntrySummary);
OnAddSelectedTrackingToDataSetOnAfterSetTrackingFilterFromEntrySummary(TempTrackingSpecification, TempEntrySummary);
if TempTrackingSpecification.FindFirst() then begin
OnAddSelectedTrackingToDataSetOnBeforeUpdateWithChange(TempEntrySummary, TempTrackingSpecification, ChangeType::Modify);
TempTrackingSpecification.Validate("Quantity (Base)",
TempTrackingSpecification."Quantity (Base)" + TempEntrySummary."Selected Quantity");
TempTrackingSpecification."Buffer Status" := TempTrackingSpecification."Buffer Status"::MODIFY;
TransferExpDateFromSummary(TempTrackingSpecification, TempEntrySummary);
TempTrackingSpecification.Modify();
UpdateTrackingDataSetWithChange(TempTrackingSpecification, true, CurrentSignFactor, ChangeType::Modify);
end else begin
TempTrackingSpecification := TrackingSpecification2;
TempTrackingSpecification."Entry No." := LastEntryNo + 1;
LastEntryNo := TempTrackingSpecification."Entry No.";
TempTrackingSpecification.CopyTrackingFromEntrySummary(TempEntrySummary);
TempTrackingSpecification."Buffer Status" := TempTrackingSpecification."Buffer Status"::INSERT;
TransferExpDateFromSummary(TempTrackingSpecification, TempEntrySummary);
if TempTrackingSpecification.IsReclass() then
TempTrackingSpecification.CopyNewTrackingFromTrackingSpec(TempTrackingSpecification);
OnAddSelectedTrackingToDataSetOnAfterCopyNewTrackingFromTrackingSpec(TempTrackingSpecification, ChangeType);
TempTrackingSpecification.Validate("Quantity (Base)", TempEntrySummary."Selected Quantity");
OnBeforeTempTrackingSpecificationInsert(TempTrackingSpecification, TempEntrySummary);
TempTrackingSpecification.Insert();
UpdateTrackingDataSetWithChange(TempTrackingSpecification, true, CurrentSignFactor, ChangeType::Insert);
end;
until TempEntrySummary.Next() = 0;Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.41.6 |
Good Sense Reviewer - Round 11Recommendation: Request ChangesWhat this PR doesThe change updates item tracking availability so outstanding unregistered warehouse and inventory pick quantities reduce the available lot quantity. It also nets reservations that already exist for the pick source, so the same allocation is not counted twice. The main code path is targeted: GetAvailableLotQty rebuilds lookup data, RetrieveLookupData now adds unregistered picks before the availability summaries are used, and the new helper groups split pick lines before subtracting source reservations. The new W1 tests cover full pick allocation, inventory pick allocation, split pick lines, and production component source pointers. The RU test file tries to mirror that coverage, but it no longer declares helper procedures that both old and new tests call. Status of previous suggestions
New observations (commits since round 10)S4 (🔴 High): RU test codeunit misses required helpers Risk assessment and necessityRisk: The product change touches lot availability for warehouse pick and inventory pick flows, so a wrong result can affect inventory allocation. The current blocking risk is compile-time: the RU test codeunit calls helper procedures that are absent from that codeunit. Necessity: The change is needed because an unregistered pick can already commit lot quantity before registration. Without this update, another demand can still see that committed lot as available.
|
Good Sense Reviewer - Round 12Recommendation: AcceptWhat this PR doesThe change updates item tracking availability so outstanding unregistered warehouse and inventory pick quantities reduce the available lot quantity. It also nets reservations that already exist for the pick source, so the same allocation is not counted twice. The product logic remains targeted, and the latest commit only completes the RU test helper set that the newly added RU tests call. The current W1 and RU tests cover the reported warehouse pick scenario, inventory picks, split pick take lines, and production component source pointers. Status of previous suggestions
New observations (commits since round 11)None - changes only addressed prior suggestions. Risk assessment and necessityRisk: The product change touches lot availability for warehouse pick and inventory pick flows, so a wrong result can affect inventory allocation. The latest commit changes only RU test helpers and removes the compile-time risk raised in the previous round. Necessity: The change is needed because an unregistered pick can already commit lot quantity before registration. Without this update, another demand can still see that committed lot as available.
|
|
TransferUnregisteredPicksToTempRec raises a paired OnBefore/OnAfter event set, but the Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.41.6 |
|
The three new IntegrationEvent publisher signatures use abbreviated record parameter names (TempGlobalReservEntry, WhseActivLine) instead of full, self-explanatory names such as TempGlobalReservationEntry and WarehouseActivityLine. Event parameter names are part of the subscriber contract, so these abbreviations make the new extension points harder to understand and inconsistent with naming guidance. Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.41.6 |
|
LocationRequiresPick reads only Location."Require Pick" but does a full-row Get on the Location table. Add SetLoadFields("Require Pick") before Get so this new per-tracking-spec availability check does not materialize every Location column just to test one flag. Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.41.6 |
|
GetAvailableLotQtyNetsProductionComponentReservationOnce calls CreateAndPostLotStockForPick(), which invokes ItemJournalLine.OpenItemTrackingLines(false) and opens the Item Tracking Lines modal page, but unlike its sibling new tests in this file, it is missing a [HandlerFunctions(...)] attribute (e.g. ItemTrackingLinesLotSNQtyModalPageHandler). The test will fail at runtime on the unhandled modal page before reaching its assertion. Knowledge: The same issue exists in these regional copies — apply the equivalent fix in each:
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.41.6 |
Good Sense Reviewer - Round 13Recommendation: AcceptWhat this PR doesThe product change keeps unregistered warehouse and inventory pick quantities from being shown as available for the same tracked lot. Since round 12, the only code change adds the missing modal page handler to the W1 and RU production component tests. That latest change is correct. The production component tests call the helper that opens Item Tracking Lines, and both tests now declare the handler needed for that modal page. The product code is unchanged in this round, and the latest checks show the affected app builds passing. Status of previous suggestions
New observations (commits since round 12)None - changes only addressed prior suggestions. Risk assessment and necessityRisk: The product change affects tracked-lot availability when unregistered picks exist, so the main functional risk remains inventory allocation. The latest commit only changes test attributes, and it reduces test runtime risk by handling the modal page opened during stock setup. Necessity: The change is needed because an unregistered pick can already commit lot quantity before registration. Without this update, another demand can still see that committed lot as available.
|
Predrag Maricic (PredragMaricic)
left a comment
There was a problem hiding this comment.
The final implementation correctly excludes outstanding warehouse and inventory picks from tracked-lot availability while avoiding double-counting reservations already represented by the pick source. Split Take lines are aggregated before reservation netting, and production-order components use the correct source-line and source-subline mapping.
The W1 and RU regression coverage exercises warehouse picks, inventory picks, existing source reservations, split Take lines, and production components.
|
Bug 646429: [master] [REPAIR] [ALL-E] Item tracking validation when lot numbers are assigned concerns the warehouse pick level rather than at the sales order level
Fixes AB#646429