Use this event to
Optional: Synchronize master data for Package Stations from 3rd party Shipping App to Tasklet Pack and Ship
Description
Package Stations is an optional entity in the "Pack and Ship" setup. Unless you have extended the "MOS Packing Station" table with your own custom fields it will generally not be needed to syncronize master data for this table.
See: Read master data from 3rd party Shipping App
Template
[IntegrationEvent(false, false)]
internal procedure OnSynchronizePackageTypes(var _PackageType: Record "MOS Package Type")
begin
end;
Example
/// <summary>
/// Interface implementation: Synchronize package types from external solution to our own internal table
/// </summary>
[EventSubscriber(ObjectType::Codeunit, Codeunit::"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(true) then; // Package Type may already exist
until IdysPackageType.Next() = 0;
end;
Version History
Version | Changes |
---|---|
MOS1.0.0 | Introduced |