1
votes

I'm trying to create Email in MS CRM 2011 throught REST WebService. I can create Email activity and even recipients (from, to, cc, bcc) by creating ActivityParty. All works great, until I try to create Email with multiple recipients – there is always only last recipient created. I googled a lot, and figured out, that CRM always delete previous and create new one, if created throught REST. So I'm asking: Is here any chance to create multiple recipients throught SOAP by JavaScript? Either when Email entity is created, or after, straight by creating multiplle ActivityParty entity?

Thanks for any suggestion or link to resource

1

1 Answers

1
votes

You need to use the email_activity_parties property and pass it an array of activity parties.

var activityParties = new Array();

var p1 = new Object();
p1.PartyId = { Id: userid, LogicalName: "systemuser" };
p1.ParticipationTypeMask = { Value: 1 };
activityParties[0] = p1;

var p2 = new Object();
p2.PartyId = { Id: contactid1, LogicalName: "contact" };
p2.ParticipationTypeMask = { Value: 2 };
activityParties[1] = p2;

var email = { 
 Subject: "Test this be",
 Description: "Yo",
 email_activity_parties = activityParties

...

Then use the email object in createRecord.