Use this event to
...
[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::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 |
---|---|
MOB5.42 | Introduced |
...