Hi community,
I'm having issues with sending e-mails from within my plugin, I'm consistently getting an error stating that 'partyobjecttypecode' is NULL:
// incident is the Entity that was changed [LogicalName = incident]
// service is the IOrganizationService
// kuc_primarycontactid is a mandatory Reference to the Entity contact.
Entity email = new Entity("email"); // create new mail email["subject"] = strSubject; email["description"] = strBody; EntityCollection to = new EntityCollection(); EntityReference contact = incident.GetAttributeValue<EntityReference>("kuc_primarycontactid"); // contact Entity party = new Entity("activityparty"); party["partyid"] = contact; to.Entities.Add(party); email["to"] = to; service.Create(email);
--> <Message>Attribute 'partyobjecttypecode' cannot be NULL</Message>
How do I get rid of this error?
*This post is locked for comments
I have the same question (0)

Report
All responses (
Answers (