Use this event to
Excerpt |
---|
Validate or update external setup tables prior to posting |
...
Note: Transactional data (License Plates and Transport Orders) are better handled in the OnPostPackingOnBeforePostWarehouseShipment event and OnPostPackingOnAfterPostWarehouseShipment events.
See also: Write transaction data to 3rd party Shipping App
...
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOS Pack API", 'OnBeforePostPacking', '', true, true)]
local procedure OnBeforePostPacking_UpdatePackingStation(_RegistrationType: Text; _PackingStation: Record "MOS Packing Station"; var _RequestValues: Record "MOB NS Request Element")
begin
if _RegistrationType <> 'PostPacking' then
exit;
// Your custom code here...
end;
Example
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOS Pack API", 'OnBeforePostPacking', '', true, true)]
local procedure OnBeforePostPacking_UpdatePackingStation(_RegistrationType: Text; _PackingStation: Record "MOS Packing Station"; var _RequestValues: Record "MOB NS Request Element")
var
ShipItUserSetup: Record "IDYS User Setup";
begin
if _RegistrationType <> 'PostPacking' then
exit;
If _PackingStation."No." = 0 then
exit;
_PackingStation.TestField("MOSSHIPIT User Name (External)");
_PackingStation.TestField("MOSSHIPIT Password (External)");
if ShipItUserSetup.Get(UserId) then begin
ShipItUserSetup.Validate("User Name (External)", _PackingStation."MOSSHIPIT User Name (External)");
ShipItUserSetup.Validate("Password (External)", _PackingStation."MOSSHIPIT Password (External)");
ShipItUserSetup.Modify();
end;
end;
Version History
Version | Changes |
---|---|
MOS1.0.0 | Introduced |
...