microsoft / ALAppExtensions

Repository for collaboration on Microsoft AL application add-on and localization extensions for Microsoft Dynamics 365 Business Central.
MIT License
785 stars 620 forks source link

[Event Request] page 6510 "Item Tracking Lines" - Add Publisher in procedure SelectEntries #26666

Closed innonav-dev closed 4 months ago

innonav-dev commented 4 months ago

Describe the request

On page 6510 "Item Tracking Lines" in procedure SelectEntries, we could use another publisher including an IsHandled parameter like our suggestion here:

    local procedure SelectEntries()
    var
        xTrackingSpec: Record "Tracking Specification";
        MaxQuantity: Decimal;
        IsHandled:Boolean;
    begin
        xTrackingSpec.CopyFilters(Rec);
        MaxQuantity := UndefinedQtyArray[1];
        if MaxQuantity * CurrentSignFactor > 0 then
            MaxQuantity := 0;
        OnSelectEntriesOnBeforeSetBinCode(Rec, ForBinCode, IsHandled); 
        if not IsHandled then begin
            Rec."Bin Code" := ForBinCode;
        end;            
        OnSelectEntriesOnBeforeSelectMultipleTrackingNo(ItemTrackingDataCollection, CurrentSignFactor);
        ItemTrackingDataCollection.SelectMultipleTrackingNo(Rec, MaxQuantity, CurrentSignFactor);
        Rec."Bin Code" := '';
        if Rec.FindSet() then
            repeat
                case Rec."Buffer Status" of
                    Rec."Buffer Status"::MODIFY:
                        begin
                            if TempItemTrackLineModify.Get(Rec."Entry No.") then
                                TempItemTrackLineModify.Delete();
                            if TempItemTrackLineInsert.Get(Rec."Entry No.") then begin
                                TempItemTrackLineInsert.TransferFields(Rec);
                                OnSelectEntriesOnAfterTransferFields(TempItemTrackLineInsert, Rec);
                                TempItemTrackLineInsert.Modify();
                            end else begin
                                TempItemTrackLineModify.TransferFields(Rec);
                                OnSelectEntriesOnAfterTransferFields(TempItemTrackLineModify, Rec);
                                TempItemTrackLineModify.Insert();
                            end;
                        end;
                    Rec."Buffer Status"::INSERT:
                        begin
                            TempItemTrackLineInsert.TransferFields(Rec);
                            OnSelectEntriesOnAfterTransferFields(TempItemTrackLineInsert, Rec);
                            TempItemTrackLineInsert.Insert();
                        end;
                end;
                OnSelectEntriesOnBeforeResetStatus(Rec);
                Rec."Buffer Status" := 0;
                Rec.Modify();
            until Rec.Next() = 0;
        LastEntryNo := Rec."Entry No.";
        CalculateSums();
        UpdateUndefinedQtyArray();
        Rec.CopyFilters(xTrackingSpec);
        CurrPage.Update(false);
    end;

    [IntegrationEvent(false, false)]
    local procedure OnSelectEntriesOnBeforeSetBinCode(var Rec: Record "Tracking Specification"; var ForBinCode: Code[20]; var IsHandled: Boolean)
    begin
    end;

Additional context

On this page we try to cover some customer specific needs in handling tracking specification. Internal work item: AB#538564

JesperSchulz commented 4 months ago

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

Build ID: 21022.