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

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 36
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.
I have the same question (0)
  • CU03102009-0 Profile Picture
    36 on at
    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;
            }
        }
    }
  • Suggested answer
    YUN ZHU Profile Picture
    97,897 Super User 2026 Season 1 on at
    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
     
  • Verified answer
    Khushbu Rajvi. Profile Picture
    21,573 Super User 2026 Season 1 on at
    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.
  • CU03102009-0 Profile Picture
    36 on at
    Thank you Khushbu RajviYUN ZHU!
     
    You people are the best!
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,140 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,009 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 960 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans