How-to: Modify Steps on License Plate in Pack & Ship

Minimum Requirements

  • Mobile WMS 5.42

Description

Modify existing steps on License Plate in the Packing window.

Use case

We want to update the value in the standard 'Weight' Step using our own calculations.
Only if the standard Weight Step is used for the selected Package Type.


OnPostAdhocRegistrationOnPackagesToShip_OnAfterAddStepToLicensePlate


    /// <summary>
    /// How to modify existing steps on License Plate Registration
    /// Case: If the standard Weight Step is used, update the default value with your own calculation.
    /// </summary>


    [EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Pack Adhoc Reg", 'OnPostAdhocRegistrationOnPackagesToShip_OnAfterAddStepToLicensePlate', '', true, true)]

    local procedure OnPostAdhocRegistrationOnPackagesToShip_OnAfterAddStepToLicensePlate(var _RequestValues: Record "MOB NS Request Element"; var _Step: Record "MOB Steps Element")
    var
        LicensePlate: Record "MOB License Plate";
        CalculatedWeight: Decimal;
    begin
        if _Step.Get_name() = 'Weight' then
            if LicensePlate.Get(_RequestValues.GetValue('LicensePlate')) then begin
                // CalculatedWeight := LicensePlate.Your_Own_Calc_Weight_Function();
                CalculatedWeight := 123;
                _Step.Set_defaultValue(CalculatedWeight);
            end;
    end;