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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Need to Filter lookup records in business central.

(0) ShareShare
ReportReport
Posted on by 2,116

Hi All,

I have one Enum type of Field in the vendor card page, and I have one field with lookup of Vendor table in the Fixed Asset card page, I want to filter lookup records in the Fixed Asset page based on selected value on the Vendor card page.

I tried to set table Relation property on the table field, but it is not working for me.

>>On fixed asset card page:

field(60151; "Gas Company"; Text[100])
        {
            DataClassification = ToBeClassified;
            TableRelation = Vendor.Name where("Vendor Type" = filter(= 3));
        }
pastedimage1675757946177v1.png

Can anyone help in this?

Thank You.

I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,794 Moderator on at

    Hi,

    You can do like as per below, instead of Table Relation, as Table relation required only Primary key field, and you are putting here Name which is not a part of the Primary key field.

    field(60151; "Gas Company"; Text[100])
            {
                DataClassification = ToBeClassified;
                trigger OnLookup()
                var
                    Vendor: Record Vendor;
                begin
                    Vendor.SetRange("Vendor type",VendorType::YourOptionhere);
                    if page.RunModal(page::"Vendor List",Vendor)=  Action::LookupOK then
                      "Gas Company" := Vendor.Name;  
                end;
    }
  • Suggested answer
    DAnny3211 Profile Picture
    11,417 Super User 2026 Season 1 on at

    Hi

    actually your code looks correct to me if your intention is to filter the vendor table for vendors that have vendor type=3

    can you insert a screenshot of what you get?

    what are the options of the enum of your Vendor Type field which I guess is Custom?

    DAniele

  • Inkey Solutions Profile Picture
    2,116 on at

    Thank You Nitin Verma, this is work for me.

  • Suggested answer
    Nitin Verma Profile Picture
    21,794 Moderator on at

    Good news

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 1,926 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,158 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 533 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans