mivra
mivra

Reputation: 1400

Is there a way how to recreate a field for a Dynamics CRM entity?

Our particular situation is that we have a DateOnly field and would like to change it to DateTime field supporting also the time portion. The operation is not allowed in UI and it's also stated in the documentation. Hence, I excepted deleting the field and recreating it with the new setting would work. However when I try to create the field with the same name the Duplicate Field Name error is thrown. I've read the column actually still exists behind in the DB.

Of course, I could create a field with a new name but it would require changing all related workflows and code customizations.

Is there a way how to overcome this issue?

Upvotes: 0

Views: 177

Answers (1)

Aron
Aron

Reputation: 3945

Deleting and recreating an attribute with the same name but different type should work - of course with the caveat that you have to remove all dependencies before deleting the attribute and recreate them with the new attribute.

The Duplicate Field Name error seems to indicate that the field still exists - perhaps the entity needs to be published after deleting.

You may also find the XrmToolbox tool Attribute Manager helpful.

It allows you to migrate an attribute and its data to a new attribute.

Upvotes: 1

Related Questions