c# - Dynamics CRM 2011 - Getting set of N:1 related entities with QueryExpression -


i'm working on custom web service crm 2011 deployment, , i'm making overview relates of our entities. have custom product entity details such product name , category, , have agreement entity, links product customer , contains product details specific customer. agreement , product have n:1 relationship.

i'm making overview page displayed on customer page in crm, should display agreements on customer. display, need retrieve information products these agreements link to, used group agreements on overview page. i've been unable find relevant/specific examples on this, , i'm stuck trying find feasible way of querying data need.

the way imagine it, use 2 queries required data. first, query gets agreements on customer. pass list second query, returns products intersect first list. possible using queryexpression, or need loop on agreement list , run separate query each individual association? i'd prefer avoid fetchxml if possible.

if understand question right, you'll need add linkentity product entity on first query. can specify attributes of product entity return well, returned aliasedvalues, aware of that.


Comments