Creating OrganizationData (ODATA) Service Reference in Dynamics CRM 2011 – The REST Endpoint (Part 2)

While there are several ways to circumvent this issue, there is really only one solution. That is to rename the field whose name is identical to the table name. I know, I know, Easier said than done right?
In fact, in the case that it’s the primary field, you have to go as far as to delete the entire table and re-create it.
Well, it’s not an easy or quick fix but, this is the only Microsoft Approved way to fix the problem.

If the field in question is any other than the primary field:

  • Create a new field with the corrected name.
  • Create an advanced find view with the old and new columns.
  • From Advanced Find, click Export and make sure the checkbox is checked that says “Make this data available for re-importing by including required column headings.”
  • Modify exported document:
  • Open the exported data in Excel, expose the entity’s IDs by un-protecting the document. You can find a detailed explanation of how to un-protect the document here http://blogs.microsoft.co.il/blogs/rdt/archive/2011/08/12/updating-crm-r…
  • Copy the data from the old to the new column.
  • Save the file as a CSV file.
  • With the file now saved as a CSV, remove the old column.
  • Delete the old field from the customization.
  • If the field in question is the primary field, the process is similar to above but, you must completely delete the entity.

  • First create a new temporary entity with all the fields and relationships of your problematic entity which will hold the data.
  • Next, similarly to above, export a backup of all records of the entity including all of the necessary fields by including those columns in your advanced find.
  • Modify exported document as described above.
  • Delete the entity and re-create it with the corrected primary field.
  • Now you can create your data map and import the file matching records to the IDs

    If you have Existing customizations, Integrations, etc. this solution may not work for you. If that is the case, you will need to circumvent this issue which I’ll explain how to do in Part 3 of this post.