How-to: Modify displaylines in Pack & Ship
Minimum Requirements
- Mobile WMS 5.42
Description
Additional text displayed on a List.
Use case
Additional text (Shipment Method) displayed on Order Header Level as part of DisplayLine 1
Additional text (Temperature) displayed on Line Level as part of DisplayLine 2
OnGetPackingOrders_OnAfterSetFromWarehouseShipmentHeader
/// <summary>
/// Modified Packing list showing Warehouse Shipment Headers to also show 'Shipment Method Code'
/// </summary>
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Pack", 'OnGetPackingOrders_OnAfterSetFromWarehouseShipmentHeader', '', false, false)]
local procedure OnGetPackingOrders_OnAfterSetFromWarehouseShipmentHeader(var _BaseOrderElement: Record "MOB NS BaseDataModel Element"; _WhseShipmentHeader: Record "Warehouse Shipment Header")
begin
_BaseOrderElement.Set_DisplayLine1(_BaseOrderElement.Get_DisplayLine1() + ' | ' + _WhseShipmentHeader."Shipment Method Code");
end;
OnLookupOnPackagesToShip_OnAfterSetFromWarehouseShipmentHeader
/// <summary>
/// Modified First element in the Packing window showing Warehouse Shipment info to also show 'Shipment Method Code'
/// </summary>
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Pack Lookup", 'OnLookupOnPackagesToShip_OnAfterSetFromWarehouseShipmentHeader', '', false, false)]
local procedure OnLookupOnPackagesToShip_OnAfterSetFromWarehouseShipmentHeader(var _LookupResponseElement: Record "MOB NS WhseInquery Element"; _WhseShipmentHeader: Record "Warehouse Shipment Header")
begin
_LookupResponseElement.Set_DisplayLine1(_LookupResponseElement.Get_DisplayLine1() + ' | ' + _WhseShipmentHeader."Shipment Method Code");
end;
OnLookupOnPackagesToShip_OnAfterSetFromLicensePlate
/// <summary>
/// Modified DisplayLine on License Plate elememt to show Custom 'Temperature' field.
/// </summary>
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Pack Lookup", 'OnLookupOnPackagesToShip_OnAfterSetFromLicensePlate', '', false, false)]
local procedure OnLookupOnPackagesToShip_OnAfterSetFromLicensePlate(var _LookupResponseElement: Record "MOB NS WhseInquery Element"; _LicensePlate: Record "MOB License Plate")
begin
if _LicensePlate.Temperature <> 0 then
_LookupResponseElement.Set_DisplayLine2(_LookupResponseElement.Get_DisplayLine2() + ' | Temp. : ' + Format(_LicensePlate.Temperature));
end;