Skip to content

[Event Request] codeunit 730 "Copy Item" - OnBeforeCopyItemPriceListLines #21991

Description

@KlaasKleermaker

Dear ALAppExtensions team,

On behalf of 4PS I would like to request integration event 'OnBeforeCopyItemPriceListLines' to be added to procedure 'CopyItemPriceListLines' in codeunit 730 "Copy Item".

    local procedure CopyItemPriceListLines(FromItemNo: Code[20]; ToItemNo: Code[20]; PriceType: Enum "Price Type"; AmountType: Enum "Price Amount Type")
    var
        NewPriceListLine: Record "Price List Line";
        PriceListLine: Record "Price List Line";
        IsHandled: Boolean; //**4PS>MS.n
    begin
        //**4PS>MS.sn
        OnBeforeCopyItemPriceListLines(FromItemNo, ToItemNo, PriceType, AmountType, IsHandled);
        if IsHandled then
            exit;
        //**4PS>MS.en

        PriceListLine.SetRange("Price Type", PriceType);
        PriceListLine.SetRange("Amount Type", AmountType);
        PriceListLine.SetRange("Asset Type", "Price Asset Type"::Item);
        PriceListLine.SetRange("Asset No.", FromItemNo);
        if PriceListLine.FindSet() then
            repeat
                NewPriceListLine := PriceListLine;
                NewPriceListLine.SetAssetNo(ToItemNo);
                NewPriceListLine.SetNextLineNo();
                NewPriceListLine.Insert();
            until PriceListLine.Next() = 0;
    end;
    [IntegrationEvent(false, false)]
    local procedure OnBeforeCopyItemPriceListLines(FromItemNo: Code[20]; ToItemNo: Code[20]; PriceType: Enum "Price Type"; AmountType: Enum "Price Amount Type"; var IsHandled: Boolean)
    begin
    end;

Internal work item: AB#462363

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions