Use this event to
...
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOS Pack API", 'OnPostPackingOnCheckUntransferredLicensePlate', '', true, true)]
local procedure OnPostPackingOnCheckUntransferredLicensePlate(_LicensePlate: Record "MOS License Plate")
begin
end;
Example
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOS Pack API", 'OnPostPackingOnCheckUntransferredLicensePlate', '', true, true)]
local procedure OnPostPackingOnCheckUntransferredLicensePlate(_LicensePlate: Record "MOS License Plate")
var
IdysSetup: Record "IDYS Setup";
IdysPackageType: Record "IDYS Package Type";
PackageType: Record "MOS Package Type";
begin
if not IsShippingProvider(_LicensePlate."Package Type") then
exit;
// Check PackageType exists in IDYS and will not error out during validation
PackageType.Get(_LicensePlate."Package Type");
IdysPackageType.Get(PackageType."Shipping Provider Package Type");
// Check we are indeed supposed to create Transport Order from our code
IdysSetup.Get();
IdysSetup.TestField("After Posting Sales Orders", IdysSetup."After Posting Sales Orders"::"Do nothing"); // TODO - baseres på LicensePlate.Source Type og/eller Whse. Document Type
end;
/// <summary>
/// Is the package type handled by the current Shipping Provider Id
/// </summary>
local procedure IsShippingProvider(_PackageType: Code[20]): Boolean
var
PackageType: Record "MOS Package Type";
begin
exit(PackageType.Get(_PackageType) and (PackageType."Shipping Provider Id" = GetShippingProviderId()));
end; Filter by label (Content by label) showLabels false showSpace false sort title title More examples excerptType simple
Version History
Version | Changes |
---|---|
MOB5.42 | Introduced |
...