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

partyid=leadid how to set lead to partid .

$
0
0

Guid emailObjectID = new Guid();

if (contact != null)
{
Entity toactivityParty = new Entity();
toactivityParty.LogicalName = "activityparty";
toactivityParty.Attributes["partyid"] = contact;
toEntities.Add(toactivityParty);
}

else if (contact == null && lead != null)
{
Entity toactivityParty1 = new Entity();
toactivityParty1.LogicalName = "activityparty";
toactivityParty1.Attributes["partyid"] = new EntityReference("lead",lead.Id);
toEntities.Add(toactivityParty1);
}

Entity oEmail = new Entity();
oEmail.LogicalName = "email";
oEmail.Attributes["to"] = toEntities.ToArray();

 emailObjectID = service.Create(oEmail); 

but this is not creating email with email[to] = lead but the same is successful with email[to]=contact. Can anyone please help?

how to assign lead to email..........?


Viewing all articles
Browse latest Browse all 46379

Trending Articles



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