Versions Compared

Key

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

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

Use this event to

Excerpt

Validate untransferred License Plates prior to creating transactions in 3rd party Shipping App


Description

Use this event to validate untransferred License Plates (transaction data) stored in internal "Pack and Ship" tables prior to writing transaction data to the 3rd party Shipping App.

See also: Write Transaction Data to 3rd party Shipping ProviderApp


Template

        [EventSubscriber(ObjectType::Codeunit,  Codeunit::"MOS Pack APIMOB Pack API",  'OnPostPackingOnCheckUntransferredLicensePlate',  '',  truetrue,  truetrue)]
        local procedure OnPostPackingOnCheckUntransferredLicensePlate OnPostPackingOnCheckUntransferredLicensePlate(_LicensePlate:  Record "MOS License PlateMOB License Plate")
    begin
        end;

Example

        [EventSubscriber(ObjectType::Codeunit,  Codeunit::"MOS Pack APIMOB Pack API",  'OnPostPackingOnCheckUntransferredLicensePlate',  '',  truetrue,  truetrue)]
        local procedure OnPostPackingOnCheckUntransferredLicensePlate MyOnPostPackingOnCheckUntransferredLicensePlate(_LicensePlate:  Record "MOS License PlateMOB License Plate")
        var
        IdysSetup        CusExternalSetup:  Record "IDYS SetupCUS External Setup";
        IdysPackageType        CusExternalPackageType:  Record "IDYS Package TypeCUS External Package Type";
        PackageType        PackageType:  Record "MOS Package TypeMOB Package Type";
        begin
                if not IsShippingProvider IsShippingProvider(_LicensePlate."Package TypePackage Type")  then
                        exit;

        // Check PackageType exists in IDYS 3rd party App and will not error out during validation        
        PackageTypevalidation        
        PackageType.Get(_LicensePlate."Package TypePackage Type");
        IdysPackageType        CusExternalPackageType.Get(PackageType."Shipping Provider Package TypeShipping Provider Package Type");
        // Check we are indeed supposed to create Transport Order from our code
        IdysSetup
        // Check we are indeed supposed to create Transport Order from our code
        CusExternalSetup.Get();
        IdysSetup        CusExternalSetup.TestField("After Posting Sales OrdersAfter Posting Sales Orders",  IdysSetupCusExternalSetup."After Posting Sales OrdersAfter Posting Sales Orders"::"Do nothingDo nothing");        //  TODO - baseres på LicensePlate.Source Type og/eller Whse. Document Type
    end;
    /// <summary>
    TODO - to be based on LicensePlate.Source Type and/or Whse. Document Type
    end;

    /// <summary>
    /// Is the package type handled by the current Shipping Provider Id
        ///  <</summary>   summary>  
        local procedure IsShippingProvider IsShippingProvider(_PackageType:  Code[20]):  Boolean
        var
        PackageType        PackageType:  Record "MOS Package TypeMOB Package Type";
        begin
                exit(PackageType.Get(_PackageType)  and and (PackageType."Shipping Provider IdShipping Provider Id"  =  GetShippingProviderIdGetShippingProviderId()));
    end;

    localprocedure GetShippingProviderId(): Code[20]
    begin
        exit('MYSHIPPINGPROVIDERID');
        end;



Version History

VersionChanges
MOS1MOB5.0.042Introduced