ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Change Request] table 38 "Purchase Header" - OnBeforeRecreatePurchLinesHandler

Open ReneZiel opened this issue 3 years ago • 5 comments

Hello, can you please move the OnBeforeRecreatePurchLinesHandler event before the PurchLineExists() check? We need this because we have an check for already registred purchase lines and give an error. An exit at this point ist not enough for us.

procedure RecreatePurchLines(ChangedFieldName: Text[100])
    var
        TempPurchLine: Record "Purchase Line" temporary;
        ItemChargeAssgntPurch: Record "Item Charge Assignment (Purch)";
        TempItemChargeAssgntPurch: Record "Item Charge Assignment (Purch)" temporary;
        TempInteger: Record "Integer" temporary;
        TempPurchCommentLine: Record "Purch. Comment Line" temporary;
        TransferExtendedText: Codeunit "Transfer Extended Text";
        ConfirmManagement: Codeunit "Confirm Management";
        ExtendedTextAdded: Boolean;
        ConfirmText: Text;
        IsHandled: Boolean;
    begin
        IsHandled := false;
        OnBeforeRecreatePurchLinesHandler(Rec, xRec, ChangedFieldName, IsHandled);
        if IsHandled then
            exit;
        if not PurchLinesExist() then
            exit;

        IsHandled := false;
        OnRecreatePurchLinesOnBeforeConfirm(Rec, xRec, ChangedFieldName, HideValidationDialog, Confirmed, IsHandled);
        if not IsHandled then
            if GetHideValidationDialog() then
                Confirmed := true
            else begin

ReneZiel avatar May 17 '23 06:05 ReneZiel

You could use the OnBeforeRecreatePurchLinesHandler event instead

kmistrytnp avatar May 17 '23 14:05 kmistrytnp

I woud like to use the OnBeforeRecreatePurchLinesHandler event. but befor run the PurchLinesExist() precedure.

ReneZiel avatar May 22 '23 09:05 ReneZiel

Sorry, I mis-read your post. I understand now and yes moving it to the beginning of the procedure would be needed for your requirement.

kmistrytnp avatar May 22 '23 09:05 kmistrytnp

This is possibly a breaking change. Some apps could depend on the previous exit from PurchLinesExists(). This request should be new event (e.g. OnRecreatePurchLinesOnBeforePurchLinesExists)

dannoe avatar Jun 01 '23 16:06 dannoe

Already implemented

AleksandricMarko avatar Sep 25 '23 15:09 AleksandricMarko