OnSearchOnBinSearch_OnAfterSetFromBin
Use this event to
Modify existing response for online search 'BinSearch' (values transferred from "Bin" table).
Template
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Online Search", 'OnSearchOnBinSearch_OnAfterSetFromBin', '', true, true)]
local procedure OnSearchOnBinSearch_OnAfterSetFromBin(_Bin: Record Bin; var _SearchResponseElement: Record "MOB NS SearchResult Element")
begin
end;
Example: Display "Qty. Base" on Hand for Bins with content
// [Example] Display "Qty. Base" on Hand for Bins with content
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Online Search", 'OnSearchOnBinSearch_OnAfterSetFromBin', '', true, true)]
local procedure MyOnSearchOnBinSearch_OnAfterSetFromBin(_Bin: Record Bin; var _SearchResponseElement: Record "MOB NS SearchResult Element")
var
WarehouseEntry: Record "Warehouse Entry";
MobWmsToolbox: Codeunit "MOB WMS Toolbox";
begin
if _SearchResponseElement.Get_DisplayLine3() = '' then begin // Not having existing text 'Empty'
WarehouseEntry.SetCurrentKey("Bin Code", "Location Code");
WarehouseEntry.SetRange("Bin Code", _Bin.Code);
WarehouseEntry.SetRange("Location Code", _Bin."Location Code");
WarehouseEntry.CalcSums("Qty. (Base)");
_SearchResponseElement.Set_DisplayLine3(WarehouseEntry.FieldCaption("Qty. (Base)") + ': ' + MobWmsToolbox.Decimal2TextAsDisplayFormat(WarehouseEntry."Qty. (Base)", false));
end;
end;
More examples
-
How-to: Search - Add new HeaderField to existing SearchType — Add a new custom HeaderField to the existing "magnifying glass" SearchType 'ItemSearch' and show a simple search response.
Version History
Version | Changes |
---|---|
MOB5.43 | Introduced |