web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Filter child lookup field based on non primary key field in parent

(0) ShareShare
ReportReport
Posted on by 1,570

Hello,

I have an entity scenario like this:

Entities: Product, Customer, CustomerProducts, CustomerPurchaseOrder, CustomerPurchaseOrderProducts. A customer purchase order only has products that are assigned to the customer.

When I am in a purchase order I have a subgrid of purchase order products.  I want to add a new product to the purchase order but it has to come from the customer assigned products.

I know it can be done, but having trouble getting the product lookup on my purchase order products to only filter based on the parent customer products.  The CustomerPurchaseOrderProducts entity doesn't have a customer field since it's linked to the purchase order.  Currently when I am in the Purchase Order Product form the product lookup shows products of all customers.  I need it to filter on the parent purchase order customer.

The navigation is like this:

Customer=>Purchase Order=>Purchase Order Products.

I hope that makes sense. Any advice?

Thanks.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Aiden Kaskela Profile Picture
    19,696 on at

    Hi Tom,

    It would be a little work, but you can filter a lookup in a supported way by using the addCustomFilter method (details: msdn.microsoft.com/.../gg334266.aspx). You should be able to add a filter on products linked to the customer through the relationship, and add a filter so it limits results to just the one customer.

    Hope this helps! I'd appreciate if you'd mark this as a Verified answer.

    Thanks,

     Aiden

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Varsha deshpande Profile Picture

Varsha deshpande 5

#2
JS-09031509-0 Profile Picture

JS-09031509-0 3

#3
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans