
string entity1 = "systemuser";
string entity2 = "new_slaconfig";
string relationshipEntityName = "new_new_slaconfig_systemuser";
QueryExpression query = new QueryExpression(entity1);
query.ColumnSet = new ColumnSet(true);
LinkEntity linkEntity1 = new LinkEntity(entity1, relationshipEntityName, "systemuserid", "systemuserid", JoinOperator.Inner);
LinkEntity linkEntity2 = new LinkEntity(relationshipEntityName, entity2, "new_slaconfigid", "new_slaconfigid", JoinOperator.Inner);
linkEntity1.LinkEntities.Add(linkEntity2);
query.LinkEntities.Add(linkEntity1);
EntityCollection collRecords = crmService.RetrieveMultiple(query);
this is return columns of entity one only.please suggest me How to get all columns of both entity?
*This post is locked for comments
I have the same question (0)Rahul,
Can you use this concept:
msdn.microsoft.com/.../gg328149.aspx;MSPPError=-2147217396
qe.LinkEntities[0].Columns.AddColumns("firstname", "lastname");
qe.LinkEntities[0].EntityAlias = "primarycontact";
Change to your column or just put all column set
qe.LinkEntities[0].Columns = new ColumnSet(true);
If you have more than 1 Link Entity then
qe.LinkEntities[1].Columns = new ColumnSet(true);
Or you can just put when you initialize the link entity
LinkEntity linkEntity2 = new LinkEntity(relationshipEntityName, entity2, "new_slaconfigid", "new_slaconfigid", JoinOperator.Inner);
linkEntity2].Columns = new ColumnSet(true);
I haven't tested it since I am not using compiler now, but you can try.
Thanks.