Armanino Blog
Article

CRM Advanced Find with Multiple Conditions for Child Records

August 13, 2015

The next installment of Tales from the Trenches for Microsoft Dynamics covers CRM Advanced Find with multiple conditions for child records.

Have you ever needed to search on Entity line items with multiple conditions for the child record? Although it is not obvious, you can set up your CRM Advanced Find query to search downward to the child entity, then back up to the parent entity so you can identify your specific conditions.

For example, let's look at the native Opportunity Products. In the below example, we would like to find all Opportunities that have both the CRM Online Enterprise and CRM Online: Professional products. If we were to simply add both products to the first criteria, Advanced Find would only search where either (but not necessarily both) of the products are associated. However, by filtering our query to identify the first search criteria, we can then circle back to identify the second criteria.

Advanced Find

Essentially we are asking the system to filter based on all Opportunities with a line item for the CRM Online Enterprise product. Once Advanced Find identifies those records, we have told it to look at the parent of those specific records, and now find the records that also have the CRM Online Professional product.

This querying strategy will work with custom entities as well as other line item-related entities including: Contract/Contract Lines, Quote/Quote Products, et cetera. Remember to start by filtering on your first search criteria, then go back to the parent and add the related line item criteria again to add your second search clause. In fact, you can expand upon this technique to add a third search criteria (or beyond) if necessary.

Find out more about Microsoft Dynamics CRM and remember to check out the other installments of Tales from the Trenches for CRM to gain great insights on fixes, updates, and insider tricks.

Stay In Touch

Sign up to stay up-to-date with the latest accounting regulations, best practices, industry news and technology insights to run your business.

Resources
Related News & Insights
sage-intacct-2024-r2-release-overview
Webinar
Discover the Newest Sage Intacct Updates With Armanino’s Experts

May 15, 2024 | 01:00 PM - 02:00 PM PT
Fireside Chat: Access to Top-Tier Talent Through Outsourcing
Webinar
The Crucial Role of Internal Communications in Driving Engagement

April 30, 2024 | 10:00 AM - 11:00 AM PT
5 Signs Your Business Has Outgrown its Legacy Accounting System
Webinar
Don't Let Your Legacy System Limit Your Potential

April 24, 2024 | 10:00 AM - 10:45 AM PT