Versions Compared

Key

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

Use this event to

Excerpt

Synchronize master data for Package Types from 3rd party Shipping App to Tasklet Pack and Ship

...

Package Types including their default Dimensions and Unit of Measures. 

Imported "MOB Package Types" will be available in Pack & Ship setup tables and in that way can be exposed on mobile devices.

...

[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB Pack API", 'OnSynchronizePackageTypes', '', false, false)]
localprocedure OnSynchronizePackageTypes(var _PackageType: Record"MOB Package Type");
begin
end;

...

    /// <summary>
    /// Interface implementation: Synchronize package types from external solution to our own internal table
    /// </summary>   
    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOS Pack API", 'OnSynchronizePackageTypes''', true, true)]
    local procedure OnSynchronizePackageTypes(var _PackageType: Record "MOS Package Type")
    begin
        SynchronizePackageTypes(_PackageType);
    end;

    internal procedure SynchronizePackageTypes(var _PackageType: Record "MOS Package Type")
    var
        IdysPackageType: Record "IDYS Package Type";
    begin
        IdysPackageType.Reset();
        if IdysPackageType.FindSet() then
            repeat
                _PackageType.Init();
                _PackageType.Validate(Code'');
                _PackageType.Validate("Shipping Provider Id", GetShippingProviderId());
                _PackageType.Validate("Shipping Provider Package Type", IdysPackageType.Code);
                _PackageType.Validate(Description, CopyStr(IdysPackageType.Description, 1, MaxStrLen(_PackageType.Description)));
                _PackageType.Validate(Default, IdysPackageType.Default);
                _PackageType.Validate(Unit, IdysPackageType.Type);
                _PackageType.Validate(Height, IdysPackageType.Height);
                _PackageType.Validate(Width, IdysPackageType.Width);
                _PackageType.Validate(Length, IdysPackageType.Length);
                _PackageType.Validate(Weight, IdysPackageType.Weight);
                if _PackageType.Insert(truethen;  // Package Type may already exist                
            until IdysPackageType.Next() 0;
    end;


Version History

VersionChanges
MOS1.0.0Introduced