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 33

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?

  • Suggested answer
    YUN ZHU Profile Picture
    79,370 Super User 2025 Season 1 on at
    RE: I want to add filter on tablerelation where the "User Name" <> rec."User Name"

    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

  • Suggested answer
    Inge M. Bruvik Profile Picture
    999 Moderator on at
    RE: I want to add filter on tablerelation where the "User Name" <> rec."User Name"

    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
    Nitin Verma Profile Picture
    21,465 Moderator on at
    RE: I want to add filter on tablerelation where the "User Name" <> rec."User Name"

    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
    DAnny3211 Profile Picture
    9,274 Moderator on at
    RE: I want to add filter on tablerelation where the "User Name" <> rec."User Name"

    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

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,280 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,034 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans