create record with manual guid / primary key RRS feed

  • Question

  • Hi All,

    Is this possible to create record in some entity in dynamics crm with set manual id / primary key / guid?

    like this:

    Entity entity = new Entity("new_test");
          entity.Attributes["new_testid"] = new Guid("688008C8-F95D-4158-BAB2-A3F695D7BEEF");
          entity.Attributes["trs_name"] = "AAAAA";

    is there any impact if I do that?

    please advise.


    Wednesday, December 31, 2014 12:03 PM

All replies

  • Yes, it can be done (if assigning to "new_testid" doesn't work, you can assign to entity.Id property)

    the impact normally is minimum or absent (delay creating the records or when you retrieve them)

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

    Wednesday, December 31, 2014 1:02 PM
  • I have try it my development server, and it's work

    actually, this question for my requirement that need do integrate between another system to CRM, which the another system has guid as their PK (primary key) and they push their record to CRM using CRM web service and put their PK / guid value as Id in CRM's entity that they pushed.

    but, I have consult with microsoft support with this technique and I don't want get trouble in later time, and they said this is not recommended from microsoft, even it work as I said before.


    Monday, January 5, 2015 4:39 AM