Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Filtering a drop down list source in a Card Page

(0) ShareShare
ReportReport
Posted on by 5,124

I have a field in Sales Header that is CODE data type and the source for this is a table for the drop down values.  When I open this table via a Card Page, I want to limit the values being shown in the field drop down list to only 2-3 values of my liking.  Can anyone help direct me to the right syntax?  I was thinking maybe work on the lookup trigger of the ddlist...but I don't know what the syntax.  I also tried to work on table relations property of that field but maybe I am not doing it right as it doesn't seem to filter.  Thank you much.

*This post is locked for comments

  • mbr Profile Picture
    mbr 5,124 on at
    RE: Filtering a drop down list source in a Card Page

    Thanks for the link MMV.  It was helpful but it also meant changing the code in the List Page but this list page is being used by other pages for ddlist.  I went with your other suggestion which is the table relation mod in the field level of table.

  • mbr Profile Picture
    mbr 5,124 on at
    RE: Filtering a drop down list source in a Card Page

    That did it!  Thank you MMV.  I modified the table relation logic in the Table Def and it worked! Much obliged.

  • Verified answer
    mmv Profile Picture
    mmv 11,465 on at
    RE: Filtering a drop down list source in a Card Page

    Hi,

    My suggestion is to change the TableRelation in the Table field with a Condition ( a conditional filter, i.e., e.g. if your above mentioned Card uses the "Document Type" as Order, you may use the specific filter of your choice, otherwise the existing option).

    format in the TableRelation property in the table -> field:

    IF (Document Type=CONST(Order)) Location WHERE (Use As In-Transit=CONST(No)) ELSE IF (Document Type=CONST(Quote)) Location

    Could you try it that way?

    Best Regards,

    MMV

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,749 on at
    RE: Filtering a drop down list source in a Card Page

    One other way i can think is to add the code on the OnLookup trigger but that does not give you dropdown.

  • mmv Profile Picture
    mmv 11,465 on at
    RE: Filtering a drop down list source in a Card Page

    Hi,

    Please check the below link too.

    http://kauffmann.nl/index.php/2011/10/17/controlling-the-drop-down-list-in-the-roletailored-client/

    Best Regards,

    MMV

  • mbr Profile Picture
    mbr 5,124 on at
    RE: Filtering a drop down list source in a Card Page

    HI Suresh,

    I implemented the TableRelations filter that you have suggested in the Page Designer level as I only want to filter the dropdown list to a few values on Sales Order Card page.  However, it doesn't seem to work as I think the TableRelations Filter in the Table Designer level supersedes it.  If I remove the TableRelations filter in the Table Designer level, it works.  But I don't want to remove it as this table is being used in other pages.  Is there a way for the Table Relations filter to kick in in the page level only or to add with?

    Please advise.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,749 on at
    RE: Filtering a drop down list source in a Card Page

    When you add the field on the Sales Header, in the table relation window specify the filter in the table filter. For example i have a table where code is the primary key with values STEST1,STEST2,VTEST1. If i want to filter always only those values starting with S then my table relation will look like this

    "Test Code" WHERE (Code=FILTER(S*))

    Where "Test Code" is the table name.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,476 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans