Versions Compared

Key

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

Use this event to

...

A sample use can be seen in our "ShipIt365 Connector" where the "MOS Packing Station" table is extended with new fields for external user names and passwords to be sent to the "Transsmart" service used by the "IDYS ShipIt365 AppSource App". Unless you have extended the "MOS Packing Station" table with your own custom fields it will generally not be needed to syncronize master data for this table.

...

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOS Pack API", 'OnSynchronizePackingStations''', true, true)]
    local procedure OnSynchronizePackingStations(var _PackingStation: Record "MOS Packing Station")
    begin
    end;

Example

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOS Pack API", 'OnSynchronizePackingStations''', true, true)]
    local procedure OnSynchronizePackingStations(var _PackingStation: Record "MOS Packing Station")
    var
        IdysUserSetup: Record "IDYS User Setup";
    begin
        IdysUserSetup.Reset();
        if IdysUserSetup.FindSet() then
            repeat
                _PackingStation.SetRange("MOSSHIPIT User Name (External)", IdysUserSetup."User Name (External)");
                if _PackingStation.IsEmpty() then begin
                    _PackingStation.Init();
                    _PackingStation."No." := '';  // Auto-assigned in OnInsert( ) if blank.
                    _PackingStation.Description := IdysUserSetup."User Name (External)";
                    _PackingStation."MOSSHIPIT User Name (External)" := IdysUserSetup."User Name User Name (External)";
                    _PackingStation."MOSSHIPIT Password (External)" := IdysUserSetup."Password (External)";
                    _PackingStation.Insert(true);
                end;
            until IdysUserSetup.Next() 0;

        _PackingStation.Reset();  // Remove any filters
    end;

tableextension 62100 "MOSSHIPIT Packing Station" extends "MOS Packing Station"
{
    fields
    {
        field(62100; "MOSSHIPIT User Name (External)"; Text[80])
        {
            Caption = 'User Name (External)';
            DataClassification = ToBeClassified;
        }
        field(62101;  "MOSSHIPIT Password (External)";   Text[80])
        {
            Caption =   'Password (External)';
            DataClassification  = ToBeClassified;
            ExtendedDatatype = Masked;
        }
    }
}


Version History

VersionChanges
MOS1.0.0Introduced

...