Use this event to
...
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOS Pack API", 'OnDiscoverShippingProviderOnBeforePostPacking', '', true, true)]
local procedure OnDiscoverShippingProvider( 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", 'OnDiscoverShippingProviderOnBeforePostPacking', '', true, true)]
local procedure OnDiscoverShippingProvider( OnBeforePostPacking_UpdatePackingStation(_RegistrationType: Text; _PackingStation: Record "MOS Packing Station"; var _RequestValues: Record "MOB NS Request Element")
var
MosPackAPI PackingStation: Record "MOS Packing Station";
ShipItUserSetup: CodeunitRecord "MOS Pack APIIDYS User Setup";
begin
MosPackAPI.SetupShippingProvider(GetShippingProviderId(), 'My custom ShippingProvider Connector App');
end; local procedure GetShippingProviderId(): Code[20]
begin
exit('MYSHIPPINGPROVIDERID') if _RegistrationType <> 'PostPacking' then
exit;
If _PackingStation."No." = 0 then
exit;
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 |
...