Posts

Showing posts from May, 2013

Creating Forward Email through SDK

Here's the sample code to create Forward Email through SDK
private static Guid CreateForwardEmail(Guid existingEmailID) { Entity existingEmail = _service.Retrieve("email", existingEmailID, new ColumnSet("from", "createdon", "to", "cc", "subject", "description", "regardingobjectid")); Entity oEmail = new Entity("email"); oEmail["regardingobjectid"] = existingEmail["regardingobjectid"]; oEmail["subject"] = "FW: " + existingEmail["subject"]; oEmail["description"] = "<FONT size=2 face='Tahoma, Verdana, Arial'><BR>------------------- Original Message -------------------<BR>"; oEmail["description"] += "<B>From:</B> " + ((EntityReference)((Microsoft.Xrm.Sdk.EntityCollection)existingEmail["from"]).Entities[0]["partyid"]).…