Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Importing attachments programmatically

Posted on by Microsoft Employee

Hi All,

1) I'm using MS Dynamics Online 2016 and trying to import attachments programmatically.

2) I have several external files that should be attached to an Account by using Account's name. I have a .csv file that has all the mapping data and manual import with wizard works, i.e. I can upload the external files and create new Notes with attachments for my Accounts with this setup file. 

3) I've tried using the code from: https://blogs.msdn.microsoft.com/crm/2012/08/06/how-to-import-attachments-programmatically/ but it doesn't work (throws Exception "The column heading does not match the attribute display label").

4) It seems that CRM SDK 2016 DataImport sample (https://msdn.microsoft.com/en-us/library/hh547396.aspx) works as such, but it doesn't do anything with attachments.

5) So, assuming I have a file called "A.pdf" and an Account named "ACME", what is the correct way to upload A.pdf to the CRM 2016 and attach it to ACME using C#?

Thanks.

*This post is locked for comments

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans