Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Use this event to

Filter Bin Content to be displayed at the mobile device for "BinContent".

Description

This event affects locations with Location."Bin Mandatory" = true.

Template

    [EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Lookup", 'OnLookupOnBinContent_OnSetFilterBinContent', '', true, true)]
    local procedure OnLookupOnBinContent_OnSetFilterBinContent(var _RequestValues: Record "MOB NS Request Element"; var _BinContent: Record "Bin Content")
    begin
    end;

Example 01: Include all Bin Content (remove "Quantity <> 0" condition)

    // [Example 01] Include all Bin Content (remove "Quantity<>0" condition)
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Lookup", 'OnLookupOnBinContent_OnSetFilterBinContent', '', true, true)]
    local procedure My01OnLookupOnBinContent_OnSetFilterBinContent(var _RequestValues: Record "MOB NS Request Element"; var _BinContent: Record "Bin Content")
    var
        MyCustomShowQuantityText: Text;
    begin
        MyCustomShowQuantityText := _RequestValues.GetValue('MyCustomShowQuantityField');   // New custom field in headerconfiguration used by the lookup page
        if MyCustomShowQuantityText = 'Include Bin Content with no inventory' then
            _BinContent.SetRange(Quantity); // Include all Bin Content records regardsless of Quantity on hand
    end;

Example 02: Combine OnSetFilter and OnInclude events to display all fixed bins but floating bins only with inventory

    // [Example 02]: Combine OnSetFilter and OnInclude events to display all fixed bins but floating bins only with inventory
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Lookup", 'OnLookupOnBinContent_OnSetFilterBinContent', '', true, true)]
    local procedure My02OnLookupOnBinContent_OnSetFilterBinContent(var _RequestValues: Record "MOB NS Request Element"; var _BinContent: Record "Bin Content")
    begin
        _BinContent.SetRange(Quantity); // Include all Bin Content records regardsless of Quantity on hand
    end;

    [EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Lookup", 'OnLookupOnBinContent_OnIncludeBinContent', '', true, true)]
    local procedure My02OnLookupOnBinContent_OnIncludeBinContent(_BinContent: Record "Bin Content"; var _IncludeInLookup: Boolean)
    begin
        _IncludeInLookup := _IncludeInLookup and ((_BinContent.Quantity <> 0) or _BinContent.Fixed);   // Exclude floating bins with no inventory
    end;


More examples


Version History

Version

Changes

MOB5.34Introduced
  • No labels