External system creating CRM records RRS feed

  • Question

  • Hi all,

    I am using CRM 2011 on premise and have had this request knocking around for a while. I'll try and explain what I want to do.

    We need to get another system within our network talking to CRM. Essentially, when a record is created in the external system, it will create a record in CRM. It's not a vast amount of data I want to pull through, only about 10 fields which I want to create a record in a custom entity, once in there I'll use workflows and plug ins to do the rest of the work.

    One of the main problems here is that the external system won't go through the usual authentication process and won't be logged on to CRM. Also, if possible, I'd like to avoid a 3rd party tool like Scribe.

    I'm hoping that someone will know about an API or web service within CRM that I can use for this task.


    Monday, June 23, 2014 8:47 AM

All replies

  • Hi,
    you can use the CRM webservices to create the records, the only thing is that you need a CRM user credentials to perform the operation.

    you can use the simplified connection and after create the record, here an example:

    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

    Monday, June 23, 2014 8:53 AM
  • Hi,

    Generally for such integrations, a so called "Service Account" is used for carry out the authentication. It's nothing special, but just another CRM user with all the necessary permissions (generally a System Administrator role) to be able to interact with CRM and carry out the required tasks.

    Once you have the "Service Account" at your disposal, you can call the CRM API using those credentials (generally stored in some kind of config file) to carry out the necessary jobs like create, update, etc.

    Using the following snippet, once you get the Organisation Service, you can call methods like Create, Update, etc.

    ClientCredentials credentials = new ClientCredentials();
    credentials.UserName.UserName = userName;
    credentials.UserName.Password = password;
    Uri serviceUri = new Uri("http://crm:5555/OrgName/XRMServices/2011/Organization.svc");
    OrganizationServiceProxy orgServiceProxy = new OrganizationServiceProxy(serviceUri, null, credentials, null);
    IOrganizationService orgService = (IOrganizationService)orgServiceProxy;

    Admin QuikView Solution for CRM 2013

    Tuesday, June 24, 2014 10:22 AM
  • Thanks for the information, between the two solutions, I'm sure we can have a good crack at getting this sorted or, at the very worst, it'll point us in the right direction.
    Wednesday, June 25, 2014 8:30 AM