web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

SETFILTER on Bin Contents List Page

(0) ShareShare
ReportReport
Posted on by 549
I have modified the Bin Contents List (Page #7305) from the Sales Order Subform to include a boolean field from the Bins Table (different table) that identifies if the Bin is flagged as "Include in Qty Available" calculation.
 
Using the OnAfterGetRecord trigger, I am able to successfully add the boolean field and see which Bins have the flag set to True.  Code and page are below.
 
Next step I want to do is limit the Bin Contents List results to only the ones where the boolean field is true.  I have tried several methods to do this but nothing works.
 
Normally I would use a SETFILTER on the OnOpenPage trigger, but since the boolean field is from another table and is evaluated on the OnAfterGetRecord trigger, I think that is too early in the code.
 
What additional code do I need to set the filter when the page is opened?
 
pageextension 50125 BinContentsListPageExt extends "Bin Contents List"
{
    layout
    {
        addafter(Dedicated)
        {
            field(InclQtyAvail; InclQtyAvail)
            {
                Caption = 'Incl. Qty Avail';
                ApplicationArea = All;
                Enabled = false;
            }
        }
    }
    var
        BinTable: Record Bin;
        InclQtyAvail: Boolean;
    trigger OnAfterGetRecord()
    begin
        BinTable.Reset();
        BinTable.SetRange("Location Code", Rec."Location Code");
        BinTable.SetRange("Code", Rec."Bin Code");
        InclQtyAvail := false;
        if BinTable.FindFirst() then begin
            InclQtyAvail := BinTable.InclQtyAvail;
        end;
    end;
}

 
I have the same question (0)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sumit Singh Profile Picture

Sumit Singh 2,056

#2
YUN ZHU Profile Picture

YUN ZHU 1,680 Super User 2025 Season 2

#3
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 1,679

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans