Use this event to
Excerpt |
---|
Validate or update external setup tables Code to be executed priorto the posting of the Packing process. |
Description
You may use this event to validate or update setup values in the 3rd party Shipping App prior to posting.
A sample use can be seen in our "ShipIt365 Connector" where external user names and passwords for the "Transsmart" service (used by the "IDYS ShipIt365 AppSource App") is updated based on which Packing Station was used for the handling.
Note: Transactional data (License Plates and Transport Orders) are better handled in the OnPostPackingOnBeforePostWarehouseShipment and OnPostPackingOnAfterPostWarehouseShipment events.
See also: Write Transaction Data to 3rd party Shipping ProviderApp
Template
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOS Pack APIMOB Pack API", 'OnBeforePostPacking', '', truetrue, truetrue)]
local procedure OnBeforePostPacking_UpdatePackingStation OnBeforePostPacking(_RegistrationType: Text; _PackingStation: Record "MOS Packing StationMOB Packing Station"; var _RequestValues: Record "MOB NS Request ElementMOB NS Request Element")
begin
if _RegistrationType <> 'PostPacking' then
exit;
// Your custom code here...
...
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)");
if ShipItUserSetup.Get(UserId) then begin
ShipItUserSetup.Validate("User Name (External)", _PackingStation."MOSSHIPIT User Name (External)");
ShipItUserSetup.Modify();
end;
if _RegistrationType <> 'PostPacking'then
exit;
// Your custom code here...
end;
Filter by label (Content by label) showLabels false showSpace false sort title title More examples excerptType simple cql label = "OnBeforePostPackingonbeforepostpacking" and label = "example" and label = "pack"
Version History
Version | Changes |
---|---|
MOB5.42 | Introduced |
...