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

I want to add filter on tablerelation where the "User Name" <> rec."User Name"

(0) ShareShare
ReportReport
Posted on by 39

I want to filter on table relation so i get all the user except the user in the record, I tried to write it like this but it gives error 
tablerelation = user."User Name" where ("User Name" <> field("User Name") 
do you know any way I can do it like that?

I have the same question (0)
  • Suggested answer
    DAnny3211 Profile Picture
    11,407 Super User 2026 Season 1 on at

    hi

    it is not feasible to do what you wrote

    you'd better do a lookuo in AL in the onlookup trigger of the field

    https://yzhums.com/5985/

    DAniele

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

    Hi,

    the operator <> you used is not possible to put here with this property, You can use either Onlookup of that field trigger.

    trigger OnLookup()

    begin

       ...

    end;

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,161 Moderator on at

    I have not tested it myself. But there is a chance it could work if you use a filter value in your table relation instead of comparing two field values directly.

         TableRelation = User."User Name" where ("User Name" = filter (<>= %1),User."User Name");

    learn.microsoft.com/.../devenv-tablerelation-property

  • Suggested answer
    YUN ZHU Profile Picture
    97,970 Super User 2026 Season 1 on at

    Hi, If it is a fixed value, it is possible, but for the field, it is recommended to use the method mentioned by Daniele and Nitin.

    pastedimage1673842257684v2.png

    pastedimage1673842246165v1.png

    Hope this helps as well.

    Thanks.

    ZHU

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

#2
YUN ZHU Profile Picture

YUN ZHU 1,046 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 932 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans