Part two of this series (thanks Mark Perez) is more straightforward. After setting up a source connection to Salesforce.com that retrieves Attachment objects and a target Dynamics CRM connection that inserts annotation objects we need to map the document from Salesforce to Dynamics CRM, and also to set up all of the information that Dynamics CRM requires for inserting attachments.
Since the latter were covered in Part 1, let's get that out of the way first.
Although the subject and file names are different this is exactly the same as in Part 1. The harder part is figuring out how to link the actual bits of the attachment. Coming from the Salesforce Attachment objects is simply linking to the Body field (S7 here) – no need to worry about whether the field is last with Salesforce:
On the Dynamics CRM side there appear to be three possible options on the annotation entity: documentbody, vfAttachmentBase64, or vfAttachment.
Using documentbody has the same result we saw in Part 1 – running this job will result in an error message that contains the following:
A high surrogate character must have a value from range (0xD800 - 0xDBFF).
We still cannot link the attachment directly into the documentbody field. Using vfAttachmentBase64 results in an error message:
CrmService.Execute(UpdateRequest) – The request failed with HTTP status 400: Bad Request.
The problem here is that we are attempting to send an attachment that we are telling the adapter is already encoded as base64, but that is actually not encoded as base64. If we use vfAttachment things work out just fine.
From the test window
And the result in Dynamics CRM:
Hope this helps. Please let me know of other scenarios or issues that you have with attachments and Dynamics CRM.

can this tool be used to import bulk attachments from siebel and move the attachments to Dynamic CRM
Posted by: venkatesh gr | 02/02/2011 at 11:16 AM
Hi,
I migrated the attachment data from salesforce using SalesForce adapter , into the MSCRM annotation table using MSCRM 2011 adapter. but the issue here all the attachment i migrated are orphange record, because at the time of migration i have not find any field which specify that the particular attachment belongs to which entity e.g case or account.
kindly let me know what we can do with this issue
I am using CRM 2011 ONLINE.
Posted by: abhishek | 08/24/2011 at 11:15 AM