lead has n:n relationship with transactioncurrency.i'm trying to retrieve the asscoaited transactioncurrency using n:n relationship.but i'm unable to get the transactioncurrency. below is my code any references appreciated.
how to retrieve n:n relationship
if (context.InputParameters.Contains("Target") && (context.InputParameters["Target"]) is Entity) { Entity en = (Entity)context.InputParameters["Target"]; QueryExpression qx = new QueryExpression("transactioncurrency"); qx.ColumnSet = new ColumnSet(true); //LinkEntity linkEntity1 = new LinkEntity("lead", "new_lead_transactioncurrency", "leadid", "transactioncurrencyid", JoinOperator.Inner); // LinkEntity linkEntity2 = new LinkEntity("new_lead_transactioncurrency", "transactioncurrency", "transactioncurrencyid", "transactioncurrency", JoinOperator.Inner); LinkEntity linkEntity1 = new LinkEntity("lead", "new_lead_transactioncurrency", "leadid", "leadid", JoinOperator.Inner); LinkEntity linkEntity2 = new LinkEntity("new_lead_transactioncurrency", "transactioncurrency", "transactioncurrencyid", "transactioncurrencyid", JoinOperator.Inner); linkEntity1.LinkEntities.Add(linkEntity2); qx.LinkEntities.Add(linkEntity1); EntityCollection entitycollect = service.RetrieveMultiple(qx); var xxx = entitycollect.Entities.Count; }
how to retrieve n:n relationship
hsk srinivas