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...
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.
I have the same question (0)
  • 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
    19,085 Super User 2025 Season 2 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
    90,705 Super User 2025 Season 2 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

Responsible AI policies

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

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

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

#1
Sumit Singh Profile Picture

Sumit Singh 2,916

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 2,687 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 2,254 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans