Tuesday, October 12, 2010

Error message when you export or delete entities in Microsoft Dynamics CRM 4.0:
"An unhandled exception occurred during the execution of the current web request"


Hi,


Recently one of my friend faced a weird type of error while exporting the customization. Error was something like

"An unhandled exception occurred during the execution of the current web request"

After searching for the error on the web... I encountered the link of Microsoft Knowledge Base article for the issue and solution to it. 
Find the URL for the same: http://support.microsoft.com/kb/947096

The common root cause for this issue is:
  • An entity form has an attribute that does not exist.
  • A primary entity of a relationship was missing during the previous import and because of which the relationship lookup attribute on the secondary entity form became orphan.
Solution:
1.    Firstly you need to find out the entity for which the error is arising. (In case you are using Export All Customizations). 
After finding the Entity you need to find out the culprit attribute on that entity form which is orphan. To find out the same follow appropriate method as given in the Microsoft KB link which I provided above or for your faster reference find the same below:
 Note The error message in the platform trace file does not display the exact attribute that causes the problem.
2.    Open the Form editor, and then find the attribute that causes the problem. To do this, use one of the following methods:
    • Look for an attribute that is missing a label.
    • Look for an attribute the properties of which have only the Name value and do not have the Display Name value or the Description value.
    • Create a new record for the entity that you found, and then find the attribute that causes the problem.
3.    Create a temporary attribute that uses the same name as the attribute in the entity form.
4.    If the attribute is not required for the deployment, follow these steps:
a.    Delete the attribute from the entity form.
b.    Publish the entity.
c.    Delete the temporary attribute.

Please feel free to post any queries/comments you have...


Thanks. J