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 Package Types will be available in Pack & Ship setup tables and in that way can be exposed on mobile devices.
See: Read master data from 3rd party Shipping App
Template
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB Pack API", 'OnSynchronizePackageTypesOnDiscoverShippingProvider', '', falsetrue, falsetrue)]
localprocedure OnSynchronizePackageTypes(var _PackageType: Record"MOB Package Type");
begin
OnDiscoverShippingProvider()
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
Version | Changes |
---|---|
MOB5.42 | Introduced |
...