Skip to content

[Event Request] Table 5901 "Service Item Line".AssistEditSerialNo #29658

@fridrichovsky

Description

@fridrichovsky

Why do you need this change?

We need this event because we are using custom field Description 3 and we need transfer it from Item to Service Item Line.

Describe the request

Please add new event.

procedure AssistEditSerialNo()
    var
        ItemLedgEntry: Record "Item Ledger Entry";
    begin
        Clear(ItemLedgEntry);
        GetServHeader();
        ItemLedgEntry.SetCurrentKey("Source Type", "Source No.", "Item No.", "Variant Code");
        ItemLedgEntry.SetRange("Source Type", ItemLedgEntry."Source Type"::Customer);
        ItemLedgEntry.SetRange("Source No.", ServHeader."Customer No.");
        if "Item No." <> '' then
            ItemLedgEntry.SetRange("Item No.", "Item No.");
        if "Variant Code" <> '' then
            ItemLedgEntry.SetRange("Variant Code", "Variant Code");
        ItemLedgEntry.SetFilter("Serial No.", '<>%1', '');
        if PAGE.RunModal(0, ItemLedgEntry) = ACTION::LookupOK then begin
            if "Item No." = '' then begin
                if Description + "Description 2" = '' then begin
                    Item.Get(ItemLedgEntry."Item No.");
                    Description := Item.Description;
                    "Description 2" := Item."Description 2";
                    //-----------------------------------------OnAssistEditSerialNoOnAfterSetDescription:BEGIN
                    OnAssistEditSerialNoOnAfterSetDescription(Rec, Item)
                    //-----------------------------------------OnAssistEditSerialNoOnAfterSetDescription:END
                end;
                Validate("Item No.", ItemLedgEntry."Item No.");
            end;
            Validate("Serial No.", ItemLedgEntry."Serial No.");
        end;
    end;

    //-----------------------------------------OnAssistEditSerialNoOnAfterSetDescription:BEGIN
    [IntegrationEvent(false, false)]
    local procedure OnAssistEditSerialNoOnAfterSetDescription(var ServiceItemLine: Record "Service Item Line"; Item: Record Item)
    begin
    end;
    //-----------------------------------------OnAssistEditSerialNoOnAfterSetDescription:END

Internal work item: AB#620271

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an event

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions