Versions Compared

Key

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

Use this event to

Excerpt

Handle tasks prior to 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.

...

    [EventSubscriber(ObjectType::CodeunitCodeunit::"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::CodeunitCodeunit::"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(UserIdthen begin
            ShipItUserSetup.Validate("User Name (External)", _PackingStation."MOSSHIPIT User Name (External)");
            ShipItUserSetup.Modify();
        end;
    end;

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
sorttitle
titleMore examples
excerptTypesimple
cqllabel = "onbeforepostpacking" and label = "example"

...