Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Open a filtered List

(1) ShareShare
ReportReport
Posted on by 24
I have a custom table and List in BC (Specifications). One field in this table contains and item number that matches an Item Number in BC. When I am on the Sales Order Line that contains an Item Number, I would like to use something like a trigger OnAssistEdit ( or some other Action) that will open the List (Specifications) and only show the record in that table where the field (Invtld) matches the Item Number. 
 
I have worked through examples but have not been able to get the result required.
 
Any suggestions are appreciated.
 
Thanks.
  • CU03102009-0 Profile Picture
    24 on at
    Open a filtered List
    Thank you Khushbu RajviYUN ZHU!
     
    You people are the best!
     
  • Verified answer
    Khushbu Rajvi. Profile Picture
    17,516 Super User 2025 Season 1 on at
    Open a filtered List
    Hi, Try with the below. 
     
    pageextension 50732 "Specifications Test" extends "Sales Order Subform"
    {
        layout
        {
            modify("No.")
            {
                AssistEdit = true;
                trigger OnAssistEdit()
                var
                    SpecList: Page "Specifications List";
                    SpecRec: Record Specifications;
                begin
                    if Rec."No." = '' then begin
                        Message('Item Number cannot be blank.');
                        exit;
                    end;
                    SpecRec.SetRange("Item No", Rec."No.");
                    SpecList.SetTableView(SpecRec);
                    if SpecList.RunModal() = Action::LookupOK then begin
                        Message('You selected a specification.');
                    end;
                end;
            }
        }
    }
     
     
    Hope this helps.
  • Suggested answer
    YUN ZHU Profile Picture
    85,865 Super User 2025 Season 1 on at
    Open a filtered List
    I think you have to put SpecItem.SetFilter("Invtld", rec."No.") before SpecList.RunModal().
    In addition, you did not use Page.SetSelectionFilter method, so you can't get the No. currently selected by the user.
     
    Hope this can give you some hints.
    Thanks.
    ZHU
     
  • CU03102009-0 Profile Picture
    24 on at
    Open a filtered List
    This is what I had so far but the list is not filtered...al items show.
     
    pageextension 50102 "Specifications Test" extends "Sales Order Subform"
    {
        layout
        {
     
            addlast(content)
            {
                /*             usercontrol(popup; popup)
                            {
                                Applicationarea = all;
     
                            } */
            }
            modify("No.")
            {
                AssistEdit = true;
                trigger OnAssistEdit()
                var
                    ItemList: Page "Item List";
                    SpecList: Page "Specifications List";
                    Item: Record Item;
                    SpecItem: Record Specifications;
                    LineNo: Integer;
                    SL: Record "sales Line";
                Begin
                    Message('You selected %1', rec."No.");
     
                    SpecList.LookupMode := true;
                    If SpecList.RunModal() = Action::LookupOK Then begin
                        SpecItem.SetFilter("Invtld", rec."No.")
                    end;
                End;
            }
        }
    }

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans