OnSynchronizePackingStations
Use this event to
Optional: Synchronize master data for Package Stations from 3rd party Shipping App to Pack and Ship
Description
Package Stations is an optional entity in the "Pack and Ship" setup. The "Pack and Ship" solution has no functionality attached to "Packing Station"s out-of-the box and syncronizing Packing Stations is entirely optional.
A sample use can be seen in our "ShipIt365 Connector" where the "MOB Packing Station" table is extended with new fields for external user names to be sent to the "Transsmart" service used by the "IDYS ShipIt365 AppSource App". Unless you have extended the "MOB Packing Station" table with your own custom fields it will generally not be needed to syncronize master data for this table.
See also: Read Master Data from 3rd party Shipping App
Template
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB Pack API", 'OnSynchronizePackingStations', '', true, true)]
local procedure OnSynchronizePackingStations(var _PackingStation: Record "MOB Packing Station")
begin
end;
Example
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB Pack API", 'OnSynchronizePackingStations', '', true, true)]
local procedure MyOnSynchronizePackingStations(var _PackingStation: Record "MOB Packing Station")
var
CusExternalPackingStation: Record "CUS External Packing Station";
begin
_PackingStation.Reset();
_PackingStation.SetFilter("CUS Ext. Packing Station Code", '<>%1', '');
_PackingStation.DeleteAll(true);
_PackingStation.Reset(); // Remove any filters
CusExternalPackingStation.Reset();
if CusExternalPackingStation.FindSet() then
repeat
_PackingStation.Init();
_PackingStation.Code := ''; // Auto-assigned in OnInsert( ) if blank.
_PackingStation.Description := CopyStr(CusExternalPackingStation.Description, 1, MaxStrLen(_PackingStation.Description));
_PackingStation."CUS Ext. Packing Station Code" := CusExternalPackingStation.Code;
_PackingStation.Insert(true);
until CusExternalPackingStation.Next() = 0;
end;
tableextension 62100 "CUS MOB Packing Station" extends "MOB Packing Station"
{
fields
{
field(62100; "CUS Ext. Packing Station Code"; Code[20])
{
Caption = 'Ext. Packing Station Code';
DataClassification = CustomerContent;
}
}
}
Version History
Version | Changes |
---|---|
MOB5.42 | Introduced |