How to upload files to the Microsoft Dynamics CRM server using C# Crm SDK?

PauliusB23 1 Reputation point
2022-11-21T13:13:39.087+00:00

Good day,

I have a task in my job working place to create a C# automatic tool that would be useful in uploading a large amount of files from the local disk to the Microsoft Dynamics 365 (on-premises) server. Once the tool uploads these files, it will be required for it to use a .CSV file, which has all the information on which files need to be attached as attachment files to certain Entity records. Currently I am a beginner and learner on how to create automatic tools for the CRM server. I have intermediate experience with C# but I am not very familiar with creating automatic tools for the CRM server. I want learn and understand the best ways in creating a automatic tool for the CRM server. I read online in the Microsoft documentation pages, stackoverflow, github and watched some tutorials which mentioned to use the Microsoft dynamics SDK for C#. I installed the SDK code samples on the local disk and the SDK assembly packages using Visual Studio Nuget tool in my Visual Studio project. However, all of these sources have information that is a bit confusing, sometimes misleading and gives me pressure in figure outing how to start writing code for this CRM tool. Currently I managed to create to login process part, which uses CrmClientService class and successfully logs into the server with the hardcoded connection string(Which later on will be located in a specific tool config file). However, I am currently stuck in understanding how to upload files to existing entity records. I've spent many days in learning and I am struggling a bit.

Could some of you give me some useful tips, recommendations or some information sources on how to start writing a simple mini tool, who will upload one file to a certain CRM server entity table record?

Once I understand how to accomplish this mini task, then it will be a nice start for me in understanding on how to upload large quantity of files that are located on the disk and required to be uploaded to the CRM server entity records as attachments. I only need to understand how to upload one simple file and I want do it in C# code.

Cheers,

Paulius

Community Center Not monitored
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jack J Jun 25,296 Reputation points
    2022-11-22T06:57:26.413+00:00

    @PauliusB23 , Welcome to Microsoft Q&A,
    Dynamics CRM is not currently supported here on QnA. I recommend that you could ask the question in Microsoft Dynamics CRM Forum.

    Best Regards,
    Jack


    If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.