Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Filter the Product Lookup in the Purchase order Lines

Posted on by 2,983

Is there a standard functionality to filter the 'No.' field of Purchase order lines so that only Items with "Vendor No." = "Purchase Header"."Buy to Vendor No" are available in the lookup dropdown?

If not, what would be the best approach to develop? We want the dropdown to display only the Vendor's items, but if the user clicks on advanced, he must be able to select any product, so the customization must only affect the dropdown list.

*This post is locked for comments

  • Suggested answer
    Alexander Ermakov Profile Picture
    Alexander Ermakov 28,094 on at
    RE: Filter the Product Lookup in the Purchase order Lines

    Perhaps this can also be useful: dynamicsuser.net/.../page-with-header-and-lines

  • Verified answer
    keoma Profile Picture
    keoma 32,675 on at
    RE: Filter the Product Lookup in the Purchase order Lines

    edit table purchase line, select field "no.", edit property table relation, add table filter "Vendor No.=FIELD(Buy-from Vendor No.)" to condition="Type=CONST(Item)" | table=item.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Filter the Product Lookup in the Purchase order Lines

    You need to have the value in the Buy-from vendor No. field of the purchase line to add that filter on the No. field of TableRelation, so for that add the code in the Purchase Line Table in the InitType function to assign the Buy-from vendor No. Value also add the code in the OnInsert Trigger of the purchase line table.

    Since it will have a value after you added the above code, you can now add that filter in the No. field of TableRelation Filter, since you want the users to remove the filter and add any other item, in that case on that field you need to Set No to TestTableRelation or ValidateTableRelation Property.

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