Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Use this event to

...

See also: Read Master Data from 3rd party Shipping App

Template

        [EventSubscriber(ObjectType::Codeunit,  Codeunit::"MOS Pack APIMOB Pack API",  'OnSynchronizePackingStations',  '',  truetrue,  truetrue)]
        local procedure OnSynchronizePackingStations OnSynchronizePackingStations(var  _PackingStation:  Record "MOS Packing StationMOB Packing Station")
    begin
        end;

Example

        [EventSubscriber(ObjectType::Codeunit,  Codeunit::"MOS Pack APIMOB Pack API",  'OnSynchronizePackingStations',  '',  truetrue,  truetrue)]
        local procedure OnSynchronizePackingStations MyOnSynchronizePackingStations(var  _PackingStation:  Record "MOS Packing StationMOB Packing Station")
        var
        IdysUserSetup        CusExternalPackingStation:  Record "IDYS User SetupCUS External Packing Station";
        begin
        IdysUserSetup        _PackingStation.Reset();
        if IdysUserSetup.FindSet() then
            repeat
                        _PackingStation.SetRangeSetFilter("MOSSHIPIT User Name (External)", IdysUserSetup."User Name (External)");
                if _PackingStation.IsEmpty() then begin
                    CUS Ext. Packing Station Code", '<>%1', '');
        _PackingStation.DeleteAll(true);
        _PackingStation.Reset();  // Remove any filters

        CusExternalPackingStation.Reset();
        if CusExternalPackingStation.FindSet() then
            repeat
                _PackingStation.Init();
                                    _PackingStation."No."Code := '';    // Auto-assigned in OnInsert( ) if blank.
                                    _PackingStation.Description  :=  IdysUserSetup."User Name (External)";
                    _PackingStation."MOSSHIPIT User Name (External)" := IdysUserSetup."User Name (External)";
                    CopyStr(CusExternalPackingStation.Description, 1, MaxStrLen(_PackingStation.Description));
                _PackingStation."CUS Ext. Packing Station Code" := CusExternalPackingStation.Code;
                _PackingStation.Insert(true);
                end;
            until IdysUserSetup            until CusExternalPackingStation.Next()  =  0;
        _PackingStation.Reset();  // Remove any filters
    end;

    tableextension 62100 "MOSSHIPIT Packing StationCUS MOB Packing Station" extends "MOS Packing StationMOB Packing Station"
    {
            fields
            {
                    field(62100;  "MOSSHIPIT User Name (External)"; Text[80])
        {
            Caption = 'User Name (External)';
            DataClassification = ToBeClassified;
        }       
    }
"CUS Ext. Packing Station Code"; Code[20])
            {
                Caption = 'Ext. Packing Station Code';
                DataClassification = CustomerContent;
            }
        }
    }


Version History

VersionChanges
MOB5.42Introduced

...