Tag Archives: MS CRM 2011 online attachment

Create and attach text file to notes in Microsoft CRM 2011

If you have requirement to create and attach file to notes in Ms CRM 2011 using code then this post is for you, you can use below code string strMessage=”this is a demo”; byte[] filename = Encoding.ASCII.GetBytes(strMessage); string encodedData = System.Convert.ToBase64String(filename); Entity Annotation = new Entity(“annotation”); Annotation.Attributes[“objectid”] = new EntityReference(“EntityName”,GUID); Annotation.Attributes[“objecttypecode”] = “EntityNAME”; Annotation.Attributes[“subject”] = “Demo”; Annotation.Attributes[“documentbody”] = encodedData; Annotation.Attributes[“mimetype”]… Read more »