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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to get all columns of both entity?

(0) ShareShare
ReportReport
Posted on by 1,562

 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)
  • Verified answer
    Aileen Gusni Profile Picture
    44,524 on at

    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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans