4
votes

I saw a feature in Dynamics CRM 2011 of attaching file to an entity with user interface. How I can attach file using Dynimcs CRM SDK 2011 and C#?

1

1 Answers

7
votes

In order to attach a file to an entity programmatically, it must first have Notes enabled on the entity (HasNotes is true).

Then, create an Annotation entity record (more information here: http://msdn.microsoft.com/en-us/library/gg334398.aspx). To associate it to a specific record, use an AssociateRequest (more here: http://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.messages.associaterequest.aspx).

There is a sample of at least creating an annotation here: http://msdn.microsoft.com/en-us/library/gg328429.aspx.