Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Filter bincode lookup field using bin

Posted on by 200

bincode lookup fields gets the data from bincontents page. But it needs to be filered from a Boolean field name 'block' if its false from bin page. bincode is common for both bin and bincontents page.

Following is my code. but doesn't work. can anyone suggest? Thanks in Advance

Bin1.RESET;

Bin1.SETRANGE("Location Code",LocationCode);

Bin1.SETRANGE(Blocks,FALSE);

IF BinContent.FINDSET THEN

REPEAT

BinContent.SETRANGE(BinContent."Item No.",ItemNo);

Bin1.SETRANGE(Code,BinContent."Bin Code");

BinContent.SETRANGE("Bin Code");

UNTIL BinContent.NEXT = 0;

IF PAGE.RUNMODAL(0,BinContent) = ACTION::LookupOK THEN

EXIT(BinContent."Bin Code");

*This post is locked for comments

  • RE: Filter bincode lookup field using bin

    Its Working..!!! Thank you very much Stefano

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: Filter bincode lookup field using bin

    This code doesn't work for sure.

    Do you want to filter BinContent for all the Bins that have Blocks = FALSE?

    You can do this by using MARKS or simply by adding a FlowField in the BinContect Table.

    In the BinContent table, add a flowfield called Bin Blocks defined as Lookup(Bin.Blocks WHERE (Location Code=FIELD(Location Code),Code=FIELD(Bin Code))).

    Then, in your lookup:

    BinContent.SETRANGE(BinContent."Item No.",ItemNo);

    BinContent.CALCFIELDS("Bin Blocks");

    BinContent.SETRANGE("Bin Blocks",FALSE); //TRUE or FALSE depending on the filter you want to apply

    IF PAGE.RUNMODAL(0,BinContent) = ACTION::LookupOK THEN

    ......

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans