Dynamics CRM 2013 : Update CRM record from external application RRS feed

  • Question

  • Dear all,

    Can anyone guide me how I can do CRUD operation in CRM from external application.

    Any help is greatly appreciated.

    Many Thanks & Regards


    Friday, November 7, 2014 12:42 PM

All replies

  • download the SDK http://www.microsoft.com/en-us/download/details.aspx?id=40321

    create a C# application

    use the simplified connection (http://msdn.microsoft.com/en-us/library/gg695810.aspx)

    and use the SDK methods. 

    CrmConnection crmConnection = CrmConnection.Parse("Url=https://XXX.crm.dynamics.com; Username=user@domain.onmicrosoft.com; Password=passwordhere;");
    OrganizationService service = new OrganizationService(crmConnection);
    Entity account = new Entity("account");
    account ["name"] = "Test Account";
    Guid accountId = service.Create(account); 

    My blog: www.crmanswers.net - Rockstar 365 Profile

    Friday, November 7, 2014 12:50 PM
  • You need to use the SDK to do the CRUD. Once you extract the SDK, you will have all the sample code inside it.


    Monday, November 10, 2014 8:06 AM
  • Dear all,

    I have tried using the above methods, it works fine when i hardcode the username, password & domain.

    My issue is that my c# application is being configured for windows authentication and I want to parse the windows authentication to the c# application.

    Any idea/guide how to parse the windows credentials?

    Many Thanks & regards


    Friday, November 14, 2014 7:43 AM
  • If you CRM is OnPremise you just need to put the organization url inside the connection string without the username and password.

    In this way it will use the integrated authentication of the user that execute your C# application

    CrmConnection crmConnection = CrmConnection.Parse("Url=http://crm.contoso.com/xrmContoso;");
    OrganizationService service = new OrganizationService(crmConnection);

    My blog: www.crmanswers.net - Rockstar 365 Profile

    Friday, November 14, 2014 8:01 AM