Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Use this event to

...

    [EventSubscriber(ObjectType::CodeunitCodeunit::"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::CodeunitCodeunit::"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";
        ShipItUserSetupCodeunitRecord "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

VersionChanges
MOS1.0.0Introduced

...