Hi,
I want to send an email from a custom workflow. for that, I have written code.
email.From = new[] { fromParty };
email.To = new[] { toParty };
tracingService.Trace("To and From are added ");
email.RegardingObjectId = new EntityReference(Incident.EntityLogicalName, caseEntity.Id);
Guid emailId = service.Create(email);
SendEmailRequest sendRequest = new SendEmailRequest();
sendRequest.EmailId = emailId;
sendRequest.TrackingToken = string.Empty;
sendRequest.IssueSend = true;
service.Execute(sendRequest);
But when I changed email.RegardingObjectId code I got nullreference exception.
email.RegardingObjectId = new EntityReference(ActivityParty.EntityLogicalName, emailEntity.Id); //This line //throws exception.
*This post is locked for comments