Change entity schema name without deleting and recreating

Viewed 4082

I'm working with a vendor developing a new project on Microsoft Dynamics 365 CRM, with quite a bit of custom functionality and custom entities. The vendor has made some assumptions about entity names that I don't agree with, and I'd like to change the entity names. I've been told that they can change the display name, but can't change the actual entity schema name without deleting an recreating it, and that would be a significant amount of effort because they'd need to then reconfigure all the relationships and business rules around those entities.

I'm not saying they're wrong, but it kind of blows my mind that Microsoft wouldn't have any way of refactoring entity names. This isn't a live application - it's in a fairly early stage of development. I'm wondering, is there any way that we can change entity names without deleting and recreating them?

One thought I had was perhaps exporting the solution and manually editing that exported solution; I believe when you export a solution it outputs a zip file that then could be imported to a separate environment - could that zip file be manually modified to change entity schema names, then imported? I don't care if that means we'd be annihilating data.

4 Answers

The XRM Toolbox Attribute Manager (by Daryl LaBar) is a pretty handy tool for "renaming" most Dynamics CRM/Dataverse attributes (except complex attributes like option sets). "Renaming" here means:

  1. Create a new attribute using the old name and schema;
  2. Copy the data from the old attribute to the new attribute;
  3. Delete the old attribute.

There are more steps than that and you have good control over which steps you may choose to not use. Attribute Manager's real strength is that it moves data, allowing you to change entity names on production systems--if you dare...

Daryl has written a concise, easy to use tool. With that said be sure to set up some tests so you can get familiar with how it works.

Yes it is possible to change the logical name of an entity without deleting and re-creating all metadata from the UI.

However, you will likely need to start from a fresh env or reset your existing one, because a lot of metadata is cached in the instance and will cause conflicts when importing. For example, SDK step GUIDs will conflict even after deletion.

The general process to rename an entity looks something like this:

  1. Replace logical name
  2. Replace logical id name
  3. Replace physical id name
  4. Replace set name
  5. Replace state and status code names
  6. Update relationships
  7. Rename files

Any tool with advanced find & replace functionality will do, but I personally recommend IntelliJ Idea, because it indexes your solution initially, making all subsequent operations nearly instant.

Related