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

Announcements

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,122

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,812 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,423 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,122 on at

    Thank You Nitin Verma, this is work for me.

  • Suggested answer
    Nitin Verma Profile Picture
    21,812 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 580 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 462 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 272 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans