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...
Suggested Answer

filter by column in the table

(0) ShareShare
ReportReport
Posted on by 30

Hello,

I need to filter a column for a specific vendor when a vendor has been selected from another table.

The supplier is entered from another table "Purchase header".
How do I filter the Vendor Number column in the Purchase Line table? I tried various ways nothing helps. Code Units/extension of tables and pages_21043D0438043C043E043A04_-_4D043A04400430043D043004_-2023_2D00_05_2D00_10-_3204_-16.16.49.png

I have the same question (0)
  • elhola Profile Picture
    30 on at

    I figured it out. you need to set a filter in the table extension

    trigger OnValidate()
    begin
    SETFILTER("Vendor No.", "Buy-from Vendor No.");
    end;

  • Suggested answer
    Govinda Kumar Profile Picture
    2,304 Moderator on at

    Hi,
    If you want to filter the Vendor column in Purchase Line table based on the selected vendor in Purchase Header table, you can use the SetFilter method in AL like this
    YourCurrentRecord.SetFilter("Vendor No.", '=%1', PurchaseHeaderTable."Buy-from Vendor No.");
    This code sets a filter on the Vendor column using = operator and vendor no. selected in Purchase Header table, you can also use SetRange and other filter methods as well.. check out this documentation for more information learn.microsoft.com/.../record-setfilter-method & learn.microsoft.com/.../record-setrange-method
    I hope this helps!
    Regards

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

#2
YUN ZHU Profile Picture

YUN ZHU 1,047 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 959 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans