Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 general forum

Connect to CRM from C# Windows button

(0) ShareShare
ReportReport
Posted on by

Dear All,

I have always got your support. Today I want a help that can help me to connect to CRM from C# windows app via a button. Then get all the contacts from contact entity which we can use for each loop. Can anyone help me with the code please.

Categories:
  • RE: Connect to CRM from C# Windows button

    Is there a way that I can call ConnectToMSCRM inside button_click event as per above code of mine to get contact entity created?

  • RE: Connect to CRM from C# Windows button

    Thanks for your reply. Thanks from bottom of my heart, I was able to resolve the issue, there was minor mistake in C# coding.. Thanks a lot for your time and help,

  • Atilin Profile Picture
    Atilin on at
    RE: Connect to CRM from C# Windows button

    Hi,

    Can you paste all your code. Specially the part where you create the connection.

  • RE: Connect to CRM from C# Windows button

    Good Morning Atilio,

    I am trying to connect to CRM online through C# windows form application, and it has permission to create or update account. If this information helps you to help me solve my issue.

  • Atilin Profile Picture
    Atilin on at
    RE: Connect to CRM from C# Windows button

    Hi Suchisuchi 

    Please, you are connecting through to the D365 with the administrator? or some user with permission to create account?

  • RE: Connect to CRM from C# Windows button

    i am trying this code to create account:-

    Entity account = new Entity("account");

               account["name"] = "Test";1256.Capture.PNG

               service.Create(account);

               MessageBox.Show("Account Created");

    I am getting ServiceModelfault exception error;-

    Can anyone please help and advice :(

    I tried everything but not able to solve it. Please help

  • Verified answer
    Atilin Profile Picture
    Atilin on at
    RE: Connect to CRM from C# Windows button

    Hi 

    Here you can find some examples about it

    https://msdn.microsoft.com/en-us/library/dn689019.aspx

    For the connection you can use XrmTooling connector, and then you can use a retrievemultiple por get all your account/contact/etc

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,407 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans