Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Table Relations and filtering

Posted on by Microsoft Employee

Hi there,

i ve been learning Dynamics nav programming for 3 days now and run into the following issue: I have a table with two fields which both relate to another table "user". The Goal is to choose a user in field 1 und choose a second user in field 2,  but the user which was selected in field 1 then shouldn´t be an Option to select in field 2. I am running out of ideas so please help me. Much appreciated! Thanks!

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Table Relations and filtering

    Thank you very much for your quick help! Saved the day!

  • Hannes Holst Profile Picture
    Hannes Holst 5,767 on at
    RE: Table Relations and filtering

    You are able to define a conditional filter in the OnLookup-trigger of a field.

    Try something like this:

    UserRec.SETFILTER("User ID", '<>%1', "Your 1st User Field");
    IF PAGE.RUNMODAL(0,UserRec) = ACTION::LookupOK THEN
      "Your 2nd User Field" := UserRec."User ID";


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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans