web
You’re offline. This is a read only version of the page.
close
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

Need to Filter lookup records in business central.

(0) ShareShare
ReportReport
Posted on by 2,100

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,698 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,397 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,100 on at

    Thank You Nitin Verma, this is work for me.

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

Responsible AI policies

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

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,229

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,867 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans