Changing Relationship Lookup attribute name

by Daniel Halan 3. January 2010 06:24

If one would like to change a relationship lookup field name on a entity, then it is important to change the name of the relationship.

For example, We have an entity called “EntityA” and it has a N:1 relationship with “EntityB”, the lookup attribute is currently called “entityb_conntectedid” and we would like to change the lookup attribute to “entitybid”. Then you normally would remove the relation, and add a new one setting the new name “entityid” to the lookup attribute.

Then you have to change the “relationship name” from the generated name “new_new_entitya_new_entityb” to for example “new_new_entitya_new_entityb2”. Otherwise there will be a conflict when importing the customizations to a CRM system that contains the old attribute making it impossible to publishing the entity if the old field exists on a form.

In the upcoming version of CRM Customization Manager (v2.0) I’ve included a warning message if one tries to import a customization that has a different name of the lookup to the same relationship so one can spot this before CRM gets broken. Also if the relationship is exported CRM Customization Manager solves the problem.

If you already have imported the new relationship and cannot publish / import the Entity, you can fix it by editing the CRM database. Access the table “OrganizationUIBase”, filter it by the ObjectTypeCode of your custom entity, then removing all the references to the old attribute in the “FormXml” column.

Related errors:
Cannot Export Customizations From Microsoft Dynamics CRM 4.0

Update:
CRM Configuration Manager now handles this.

blog comments powered by Disqus

Blog3ngine dot NET 1.6.1.2
Theme by Daniel Halan

About the author

Daniel Halan Daniel Halan, M.Sc. systems architect in Sweden.

Working primary with Microsoft .NET, Dynamics CRM, XRM & Web Read more...

The content of this site are my own personal opinions and do not represent my employer's view in anyway.


Follow Me
@Hal9000_ could be that theirs suits were designed to look good, making it hard to aim in those hemlets. classic aesthetics vs functionality 10 Apr 2011

Microsoft Dynamics Salary Survey 2012

Nigel Frank International would like to invite you to complete our annual survey of global Microsoft Dynamics salaries. The survey will only take a couple of minutes to complete and your response and any personal details will be kept strictly confidential.

Prizes,
1st  iPad2 16gb Wi-Fi + 3G 
2nd Xbox 360 + Kinect 
3rd Kindle Keyboard w/ Free 3G + Wi-Fi 
4th MS LifeCam Studio Webcam 
5th MS Arc Touch Mouse 

You will also receive a FREE copy of the Salary Survey report once it has been compiled. 

Take the Salary Survey 
The survey is available in 12 languages for your convenience.