简体   繁体   中英

CRM Dynamics 2013 Get Connections in entity by Connection Role

I am new to CRM Dynamics and very novice in development for it. I have the following situation at hand which is as follows:

I have an Account entity which can have multiple connections to it. Through code, SDK, I am trying to retrieve all the connections which are of a specific connection role. So far I am able to get all connections related to the Account Entity, however I am not able to determine what business role they have. Can someone help please?

 OrganizationServiceContext _orgContext = new OrganizationServiceContext(service);

        try
        {
            connections = (from conn in _orgContext.CreateQuery<Connection>()
                            where conn.Record1Id.Id == account.Id
                            select conn).ToList();

I wish that in this LINQ statement (where clause) I can filter out on those with a specific connection role.

Also can someone guide me to good ebooks regarding development for CRM Dynamics 2013

you are using Late Bound Queries . you can write Linq standard Query Operators with the help of OrganizationServiceContext class.

try this

var connections = _orgContext.CreateQuery("connection").ToList().Where(w=>w.Id==account.Id).Select(s=>s);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM