locked
Currupt custom entity RRS feed

  • Question

  • I somehow managed to currupt one of my custom entitys.  I can not publish it and I can not delete it without getting a non-descriptive error.

    Can it manually be removed?  Can the changes that are pending be undone?

    This entity is in a test enviorment, so I am not very concerned.  I will likely be reloading the software at some point anyway.  But I would like to know how to fix the problem if it comes up in a production enviorment.
    Sunday, July 5, 2009 8:36 PM

Answers

  • This caused by a missing attribute in the mapping (the attribute is in the mapping, but no longer on the related entity. )

    A MSCRM Trace will help identify the missing field - you can add it back to the original entity (exactly as it was) - then remove from the mapping between the entities, delete the mapping, then delete the entitiy and the temporarily recreated attribute.


    Scott Sewell, CustomerEffective | http:\\blog.CustomerEffective.com | Twitter:@ScottSewell
    Monday, July 6, 2009 2:32 PM
    Moderator

All replies

  • What is the error in the event viewer?  You can also download the diag tool and turn dev errors on to see if you receive a more descriptive error message.
    Best Regards, Donna
    Sunday, July 5, 2009 8:48 PM
  • There is no event log message which occurs at teh exact time of the CRM error, but there is an ASP.net error posted when a user first connects:

    Event code: 3005

    Event message: An unhandled exception has occurred.

    Event time: 7/5/2009 10:07:06 PM

    Event time (UTC): 7/6/2009 2:07:06 AM

    Event ID: b5df62e07c48403283db9629e236727f

    Event sequence: 4254

    Event occurrence: 6

    Event detail code: 0

     

    Application information:

    Application domain: /LM/W3SVC/1/ROOT-1-128912306097992449

    Trust level: Full

    Application Virtual Path: /

    Application Path: c:\inetpub\wwwroot\

    Machine name: DOMAIN-PDC

     

    Process information:

    Process ID: 1276

    Process name: w3wp.exe

    Account name: NT AUTHORITY\NETWORK SERVICE

     

    Exception information:

    Exception type: TargetInvocationException

    Exception message: Exception has been thrown by the target of an invocation.

     

    Request information:

    Request URL: http://crm.DOMAIN.com/DOMAIN/_Common/icon.aspx?objectTypeCode=10006&iconType=NavigationIcon&inProduction=1&cache=1

    Request path: /DOMAIN/_Common/icon.aspx

    User host address: blah.blah.blah.blah

    User: DOMAIN\username

    Is authenticated: True

    Authentication Type: Negotiate

    Thread account name: NT AUTHORITY\NETWORK SERVICE

     

    Thread information:

    Thread ID: 9

    Thread account name: NT AUTHORITY\NETWORK SERVICE

    Is impersonating: False

    Stack trace: at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

    at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)

    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

    at System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object[] values)

    at Microsoft.Crm.Extensibility.InternalOperationPlugin.Execute(IPluginExecutionContext context)

    at Microsoft.Crm.Extensibility.PluginStep.Execute(PipelineExecutionContext context)

    at Microsoft.Crm.Extensibility.Pipeline.Execute(PipelineExecutionContext context)

    at Microsoft.Crm.Extensibility.MessageProcessor.Execute(PipelineExecutionContext context)

    at Microsoft.Crm.Extensibility.InternalMessageDispatcher.Execute(PipelineExecutionContext context)

    at Microsoft.Crm.Extensibility.ExternalMessageDispatcher.Execute(String messageName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, PropertyBag fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId)

    at Microsoft.Crm.Sdk.RequestBase.Process(Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId)

    at Microsoft.Crm.Sdk.RequestBase.Process(CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId)

    at Microsoft.Crm.Sdk.CrmServiceInternal.Execute(RequestBase request, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId)

    at Microsoft.Crm.Sdk.InProcessCrmService.Execute(Object request)

    at Microsoft.Crm.Application.Platform.ServiceCommands.PlatformCommand.ExecuteInternal()

    at Microsoft.Crm.Application.Platform.ServiceCommands.RetrieveMultipleCommand.Execute()

    at Microsoft.Crm.Application.Platform.Customization.RetrieveInProductionOrganizationUIByOrgId(Guid organizationId, Int32 objectTypeCode)

    at Microsoft.Crm.Application.Pages.Common.Icon.GetIconBits(Int32 objectTypeCode, IconType iconType, Boolean inProduction)

    at Microsoft.Crm.Application.Pages.Common.Icon.ConfigurePage()

    at Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e)

    at System.Web.UI.Control.PreRenderRecursiveInternal()

    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

     

     

    Custom event details:

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

    Monday, July 6, 2009 2:08 AM
  • I've had this happen a few times, seems to fall into one of these categories:

    1.  There's a field on the form that is a lookup to an entity that doesn't exist anymore

    2.  There's a field in one of the system views that is from a related entity, but that entity has not been imported or has been removed

    3.  There's some javascript in an OnLoad, OnSave, or OnChange that has strange code in it.

    In these three scenarios, some agressive deleting of fields/code off the form/view will do it.  But in one previous situation, no amount of deleting/cleaning my forms and views would resolve the issue.  In that case MSFT support gave me some SQL to take out the non-published XML out of the entitybase table if I remember correctly, and that allowed me to publish and then delete the entity.  I'd suggest checking your forms and views carefully and if you don't see anything you can remove, might log a case w/ MSFT before you dig into the sql tables directly

     

     


    Ryan | Zero2Ten | http://www.zero2tencrm.com/
    Monday, July 6, 2009 3:46 AM
  • I've had this happen a few times, seems to fall into one of these categories:

    1.  There's a field on the form that is a lookup to an entity that doesn't exist anymore

    2.  There's a field in one of the system views that is from a related entity, but that entity has not been imported or has been removed

    3.  There's some javascript in an OnLoad, OnSave, or OnChange that has strange code in it.

    In these three scenarios, some agressive deleting of fields/code off the form/view will do it.  But in one previous situation, no amount of deleting/cleaning my forms and views would resolve the issue.  In that case MSFT support gave me some SQL to take out the non-published XML out of the entitybase table if I remember correctly, and that allowed me to publish and then delete the entity.  I'd suggest checking your forms and views carefully and if you don't see anything you can remove, might log a case w/ MSFT before you dig into the sql tables directly

     

     


    Ryan | Zero2Ten | http://www.zero2tencrm.com/
    also you can check you enitity's attributes for empty display names
    Tiaan van Niekerk http://crmdelacreme.blogspot.com Skype:tiaan.van.niekerk1
    Monday, July 6, 2009 4:17 AM
  • Hi,

    This can be caused by a missing attribute or a missing label for an attribute.

    Check in the XML of the forms and views and the XML of the entity and then try to find out if all the attributes that you can see in there are still viewable in the CRM UI.
    If not you should correct the XML and then update the database.

    Also try to check if in the form you have any lookup for a relationship that doesn't exist anymore.

    The XML for the Form is in the OrganizationUIBase table and you can also check the XML for the views in the UserQueryBase and in the SavedQueryBase.

    This is unsupported by Microsoft!
    Also please note that correcting the XML might be tricky sometimes.

    Cheers,
    André
    Monday, July 6, 2009 1:46 PM
  • The problem appears to be caused by the 1:N relationship between the custom entity and the Account and Case entitys.  Trying to delete the relationship (from either the account, case or custom entity) results in an error.
    Monday, July 6, 2009 2:11 PM
  • This caused by a missing attribute in the mapping (the attribute is in the mapping, but no longer on the related entity. )

    A MSCRM Trace will help identify the missing field - you can add it back to the original entity (exactly as it was) - then remove from the mapping between the entities, delete the mapping, then delete the entitiy and the temporarily recreated attribute.


    Scott Sewell, CustomerEffective | http:\\blog.CustomerEffective.com | Twitter:@ScottSewell
    Monday, July 6, 2009 2:32 PM
    Moderator
  • Yes this was the problem.

    There was a missing association to another custom entity.  I added the association and was able to delete the entity.

    Thank you all.
    Tuesday, July 7, 2009 1:14 PM