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


Description

Package Types including their default Dimensions and Unit of Measures. 

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

See: Read master data from 3rd party Shipping App

Template

        [IntegrationEvent(false, falseEventSubscriber(ObjectType::Codeunit, Codeunit::"MOB Pack API", 'OnDiscoverShippingProvider', '', true, true)]
    internal    localprocedure OnSynchronizePackageTypes OnDiscoverShippingProvider(var _PackageType: Record "MOS Package Type")
    begin
    )
    begin
    end;


Example

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

    
    internal procedure SynchronizePackageTypes SynchronizePackageTypes(var  _PackageType:  Record "MOS Package TypeMOB Package Type")
        var
        IdysPackageType        ExternalPackageType:  Record "IDYS Package TypeExternal Package Type";
    begin
        IdysPackageType   // Package Type table in 3rd Party App
    begin
        ExternalPackageType.Reset();
        if IdysPackageType        if ExternalPackageType.FindSet()  then
                        repeat
                                _PackageType.Init();
                                _PackageType.Validate(Code,  '');
                                _PackageType.Validate("Shipping Provider IdShipping Provider Id",  GetShippingProviderIdGetShippingProviderId());
                                _PackageType.Validate("Shipping Provider Package TypeShipping Provider Package Type",  IdysPackageTypeExternalPackageType.Code);
                                _PackageType.Validate(Description,  CopyStrCopyStr(IdysPackageTypeExternalPackageType.Description,  1,  MaxStrLenMaxStrLen(_PackageType.Description)));
                                _PackageType.Validate(Default,  IdysPackageTypeExternalPackageType.Default);
                                _PackageType.Validate(Unit,  IdysPackageTypeExternalPackageType.Type);
                                _PackageType.Validate(Height,  IdysPackageTypeExternalPackageType.Height);
                                _PackageType.Validate(Width,  IdysPackageTypeExternalPackageType.Width);
                                _PackageType.Validate(Length,  IdysPackageTypeExternalPackageType.Length);
                                _PackageType.Validate(Weight,  IdysPackageTypeExternalPackageType.Weight);
                if                 if _PackageType.Insert(true)  then;    //  Package Type may already exist                
            until IdysPackageTypePackage Type may already exist                
            until ExternalPackageType.Next()  0;
    = 0;
    end;

    localprocedure GetShippingProviderId(): Code[20]
    begin
        exit('MYSHIPPINGPROVIDERID');
    end;

Version History

VersionChanges
MOS1
MOB5.
0.0
42Introduced