Problem: When you go to Settings/Customization/Export Customizations and attempt to export all customizations, you get the following error:
"An unhandled exception occurred during the execution of the current web request." The screen looks like this:
This problem is caused by an attribute being referenced on a form without the relationship being present. This can happen when a relationship gets deleted without the lookup fields being removed from the form, or by importing entities that have a 1:N relationship without importing the relationship—sometimes this happens when entities are imported one at a time.
Solution: You need to figure out which entity has the problem. You can do this by running the CRM 4.0 Diagnostic Tool, enabling platform tracing, and recreating the error by attempting to export customizations. The log file that is generated by the platform trace should tell you which entity has the problem.
Another way to locate the problem entity is to attempt to export a smaller subset of entities. Attempt 3-5 at a time going down the list until you get to a group that throws the error. Then try to export each of these individually, until you get to the one that throws the error.
Once you have found the problem entity, go to forms and views in entity customization and open the form view. You will see which attributes are causing the problem, as they will appear grayed out. Double click on them and go to the name tab. This will tell you what the name of the attribute is.
Next, go to the attribute tab for the entity customization, and create a new attribute with the name of the deleted attribute. Save and publish.
Now you should be able to export your customizations. You can then delete the fields from the form, publish, delete the temporary attributes that you created, publish, then set up the relationship again if desired.
Hello Joel,
Thank you for the post. This really helped out for us in identifying a lookup pointing to a deleted relationship. Thanks again for sharing the info.
Posted by: Pratima | December 19, 2008 at 05:12 PM
Verrrrry helpful. I was trying to move part of an XRM application and got stuck. This was the answer!
Thanks,
Stephen V Noe, CRM/MCT
http://mscrmmaster.com
Posted by: Stephen V Noe | July 01, 2009 at 03:19 PM
Hi, wrote a fix for this problem in the latest version of CRM Customization Manager, by using a flag called "include related entities" all relationships will be included and the program checks if any duplicate schema exists and if so deletes it before doing an import.
You can download CRM Customization Manager here,
http://blog.halan.se/post/CRM-Configuration-Manager.aspx
Posted by: Daniel Halan | February 27, 2010 at 09:45 AM
Same thing happened to me.
Posted by: Nate | June 10, 2010 at 04:38 AM