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...
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,397 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,698 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,105 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
    95,329 Super User 2025 Season 2 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

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

#2
Jainam M. Kothari Profile Picture

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

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans