Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Retrieving contact information from partylist field in phonecall entity on create

$
0
0

I'm working on a plugin written in c# for an online instance of dynamics crm 2016 update 1.

As said in title, i need to retrieve contact information from a "phonecall" entity created filling the "to" field. that's the code that's not working for me

        try
        {
            XrmServiceContext svcContext = new XrmServiceContext(service);

            EntityCollection to = entity.GetAttributeValue<EntityCollection>("to");

            for (int i = 0; i < to.Entities.Count; i++)
            {
                ActivityParty activityParty = to[i].ToEntity<ActivityParty>();
                Contact contact = (from c in svcContext.ContactSet where c.Id.Equals(activityParty.ActivityId.Id) select c).FirstOrDefault();
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message + "\n" + ex.InnerException.Message);
        }

the problem it's that activityParty.ActivityId.Id returns an Id that doesn't match with any contanct in crm, anyone could give me a suggestion?


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>