locked
Unexpected error trying to deactivate accounts in CRM 2011 RRS feed

  • Question

  • We are unable to deactivate Account records in CRM 2011.  Whenever anyone tries to do so, the action fails with an "Unexpected Error" dialog.  If I download the error log, it shows this:

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: An unexpected error occurred.Detail:
    <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
      <ErrorCode>-2147220970</ErrorCode>
      <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
      <Message>An unexpected error occurred.</Message>
      <Timestamp>2011-09-06T17:41:07.2917126Z</Timestamp>
      <InnerFault i:nil="true" />
      <TraceText i:nil="true" />
    </OrganizationServiceFault>

     

    Tuesday, September 6, 2011 6:23 PM

Answers

  • OK - I think they found the answer.  It appears this is a problem in migration from version 4.0 to 2011.  The solution was to run this SQL UPDATE statement against my CRM database:

    update accountbase set merged=0 where merged is NULL

    After running this update I was able to deactivate accounts. 


    • Edited by dshradik Tuesday, October 18, 2011 5:24 PM
    • Proposed as answer by James Reinhardt Tuesday, May 15, 2012 4:01 PM
    • Marked as answer by dshradik Tuesday, May 15, 2012 6:20 PM
    Tuesday, October 18, 2011 5:24 PM
  • We were experiencing the same issue.

    We were running without any of the rollups.  Today we installed rollup 3 and we are now able to deactivate the accounts that we could not deactivate before.

     

    • Proposed as answer by pmdci Monday, September 12, 2011 3:30 PM
    • Marked as answer by Donna EdwardsMVP Sunday, September 18, 2011 12:58 PM
    Thursday, September 8, 2011 3:05 PM
  • It's the same for ContactBase

    Update AccountBase set Merged = 0 where Merged is Null
    Update ContactBase set Merged = 0 where Merged is Null
    

    This two statements fixed the problems with deactivating Accounts und Contacts

    • Marked as answer by dshradik Tuesday, May 15, 2012 6:20 PM
    Monday, February 6, 2012 11:02 AM

All replies

  • Getting the same error...anybody?
    Tuesday, September 6, 2011 7:16 PM
  • Can you turn on tracing and replicating the error?
    The postings on this site are solely my own and do not represent or constitute Hitachi Consulting's positions, views, strategies or opinions.
    Tuesday, September 6, 2011 7:27 PM
  • Here is the trace:

    [2011-09-06 18:20:35.304] Process: w3wp |Organization:366b9c59-9bb2-436a-8680-460b8312eb9e |Thread:    3 |Category: Platform.Sdk |User: 4152fe2a-2855-4bba-8287-1a575be13599 |Level: Error | VersionedPluginProxyStepBase.Execute
    >Web Service Plug-in failed in SdkMessageProcessingStepId: {3ACDBB1B-EA3E-DB11-86A7-000A3A5473E8}; EntityName: account; Stage: 30; MessageName: SetStateDynamicEntity; AssemblyName: Microsoft.Crm.Extensibility.InternalOperationPlugin, Microsoft.Crm.ObjectModel, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35; ClassName: Microsoft.Crm.Extensibility.InternalOperationPlugin; Exception: Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
       at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType 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(IServiceProvider serviceProvider)
       at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)
       at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
    Inner Exception: System.InvalidCastException: Specified cast is not valid.
       at Microsoft.Crm.BusinessEntities.BusinessProcessObject.InternalSetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, BusinessEntity originalEntity, ExecutionContext context, BusinessEntity entity)
       at Microsoft.Crm.BusinessEntities.BusinessProcessObject.InternalSetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, BusinessEntity originalEntity, ExecutionContext context)
       at Microsoft.Crm.BusinessEntities.BusinessProcessObject.SetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, BusinessEntity originalEntity, ExecutionContext context)
       at Microsoft.Crm.BusinessEntities.BusinessProcessObject.SetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, ExecutionContext context)
    .
    [2011-09-06 18:20:35.398] Process: w3wp |Organization:366b9c59-9bb2-436a-8680-460b8312eb9e |Thread:    3 |Category: Exception |User: 4152fe2a-2855-4bba-8287-1a575be13599 |Level: Error | CrmException..ctor
     at CrmException..ctor(String message, Exception innerException, Int32 errorCode, Boolean isFlowControlException)
     at CrmException..ctor(Exception innerException, Int32 errorCode, Object[] arguments)
     at VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
     at Pipeline.Execute(PipelineExecutionContext context)
     at MessageProcessor.Execute(PipelineExecutionContext context)
     at InternalMessageDispatcher.Execute(PipelineExecutionContext context)
     at ExternalMessageDispatcher.ExecuteInternal(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, String messageName, String requestName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, ParameterCollection fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId, Guid transactionContextId, Int32 invocationSource, Nullable`1 requestId, Version endpointVersion)
     at ExternalMessageDispatcher.Execute(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, String messageName, String requestName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, ParameterCollection fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId, Guid transactionContextId, Int32 invocationSource, Nullable`1 requestId)
     at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)
     at OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)
     at InprocessServiceProxy.ExecuteCore(OrganizationRequest request)
     at PlatformCommand.XrmExecuteInternal()
     at AccountRecordPageHandler.ChangeState(Object sender, DataEventArgs e)
     at DataEventProcessor.Raise(FormEventId eventId, FormState state, String objectId, Entity entity)
     at AppForm.RaiseDataEvent(FormEventId eventId)
     at EndUserForm.Initialize(Entity entity)
     at CustomizableForm.Execute(Entity entity, FormDescriptor fd)
     at AccountRecordPageHandler.ConfigureFormHandler()
     at GenericEventProcessor.RaiseEvent(String eventName)
     at PageManager.OnPreRender(EventArgs e)
     at Control.PreRenderRecursiveInternal()
     at Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
     at Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
     at Page.ProcessRequest()
     at Page.ProcessRequest(HttpContext context)
     at CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
     at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
     at ApplicationStepManager.ResumeSteps(Exception error)
     at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
     at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
     at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)
    >Crm Exception: Message: An unexpected error occurred., ErrorCode: -2147220970, InnerException: System.InvalidCastException: Specified cast is not valid.
       at Microsoft.Crm.BusinessEntities.BusinessProcessObject.InternalSetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, BusinessEntity originalEntity, ExecutionContext context, BusinessEntity entity)
       at Microsoft.Crm.BusinessEntities.BusinessProcessObject.InternalSetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, BusinessEntity originalEntity, ExecutionContext context)
       at Microsoft.Crm.BusinessEntities.BusinessProcessObject.SetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, BusinessEntity originalEntity, ExecutionContext context)
       at Microsoft.Crm.BusinessEntities.BusinessProcessObject.SetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, ExecutionContext context)
    [2011-09-06 18:20:35.398] Process: w3wp |Organization:366b9c59-9bb2-436a-8680-460b8312eb9e |Thread:    3 |Category: Platform |User: 4152fe2a-2855-4bba-8287-1a575be13599 |Level: Error | MessageProcessor.Execute
    >MessageProcessor fail to process message 'SetStateDynamicEntity' for 'account'.
    [2011-09-06 18:20:35.413] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread:    3 |Category: Platform |User: 00000000-0000-0000-0000-000000000000 |Level: Error | ExceptionConverter.ConvertMessageAndErrorCode
    >System.InvalidCastException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #27B8BDCB: System.InvalidCastException: Specified cast is not valid.
    >   at Microsoft.Crm.BusinessEntities.BusinessProcessObject.InternalSetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, BusinessEntity originalEntity, ExecutionContext context, BusinessEntity entity)
    >   at Microsoft.Crm.BusinessEntities.BusinessProcessObject.InternalSetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, BusinessEntity originalEntity, ExecutionContext context)
    >   at Microsoft.Crm.BusinessEntities.BusinessProcessObject.SetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, BusinessEntity originalEntity, ExecutionContext context)
    >   at Microsoft.Crm.BusinessEntities.BusinessProcessObject.SetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, ExecutionContext context)
    [2011-09-06 18:20:35.413] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread:    3 |Category: Exception |User: 00000000-0000-0000-0000-000000000000 |Level: Error | CrmException..ctor
     at CrmException..ctor(String message, Exception innerException, Int32 errorCode, Boolean isFlowControlException)
     at CrmException..ctor(String message, Int32 errorCode)
     at PlatformCommand.CreateCrmExceptionFromServiceFault(FaultException`1 fe)
     at PlatformCommand.XrmExecuteInternal()
     at AccountRecordPageHandler.ChangeState(Object sender, DataEventArgs e)
     at DataEventProcessor.Raise(FormEventId eventId, FormState state, String objectId, Entity entity)
     at AppForm.RaiseDataEvent(FormEventId eventId)
     at EndUserForm.Initialize(Entity entity)
     at CustomizableForm.Execute(Entity entity, FormDescriptor fd)
     at AccountRecordPageHandler.ConfigureFormHandler()
     at GenericEventProcessor.RaiseEvent(String eventName)
     at PageManager.OnPreRender(EventArgs e)
     at Control.PreRenderRecursiveInternal()
     at Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
     at Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
     at Page.ProcessRequest()
     at Page.ProcessRequest(HttpContext context)
     at CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
     at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
     at ApplicationStepManager.ResumeSteps(Exception error)
     at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
     at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
     at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)
    >Crm Exception: Message: An unexpected error occurred., ErrorCode: -2147220970
    [2011-09-06 18:20:35.429] Process: w3wp |Organization:366b9c59-9bb2-436a-8680-460b8312eb9e |Thread:    3 |Category: Application |User: 00000000-0000-0000-0000-000000000000 |Level: Error | ErrorInformation.LogError
    >MSCRM Error Report:
    --------------------------------------------------------------------------------------------------------
    Error: An unexpected error occurred.

    Error Number: 0x80040216

    Error Message: An unexpected error occurred.

    Error Details: An unexpected error occurred.

    Source File: Not available

    Line Number: Not available

    Request URL: http://crm/NOVARADCORP/userdefined/edit.aspx?_gridType=1&etc=1&id=%7bD0DE6E90-3E19-4BCF-B5DA-0DE02F58007D%7d&pagemode=iframe&rskey=75559043&sitemappath=Workplace%7cCS%7cnav_cases

    Stack

     

    Wednesday, September 7, 2011 12:29 AM
  • We were experiencing the same issue.

    We were running without any of the rollups.  Today we installed rollup 3 and we are now able to deactivate the accounts that we could not deactivate before.

     

    • Proposed as answer by pmdci Monday, September 12, 2011 3:30 PM
    • Marked as answer by Donna EdwardsMVP Sunday, September 18, 2011 12:58 PM
    Thursday, September 8, 2011 3:05 PM
  • Thursday, September 8, 2011 3:19 PM
    Moderator
  • I run the Plugin Registration Tool and I don't see any, but I'm not sure I'm looking in the right place. 

    If I view by Entity I only see:
    (Entity) transactioncurrency
        (Message) RetrieveExchangeRate
            ...

    Monday, September 12, 2011 7:22 PM
  • dshradik,

    Did you figure this one out?  We are getting the exact same error when attempting to deactivate Contacts.  We have a plugin registered on Create and Update of a Contact but I don't see why this would cause the error.  We have a similar error when merging Accounts.

    Thanks

    Monday, September 19, 2011 6:54 PM
  • Nope.  Problem still exists.  I have been hoping that someone that someone could provide an answer.  Since there seem to be a number of people getting this error it would be nice if Microsoft would jump in and investigate.
    Tuesday, September 20, 2011 11:46 PM
  • Has anyone found an answer to this? I'm seeing this at a client as well.  They are on UR3 and receiving the issue on some contacts, but not all.

     

     


    JS
    Thursday, September 29, 2011 5:06 PM
  • Since I have received no solution from this forum, I have finally knuckled under and opened a ticket with Microsoft.  I'll report back with the solution they come up with.
    Tuesday, October 4, 2011 5:04 PM
  • I'm having the same error after a migration from CRM4 to 2011 to register a new user appears the same error. I do not know what the solution this is happening in many customers still do not know the cause.
    Wednesday, October 5, 2011 4:49 PM
  • any response from Microsoft?
    Tuesday, October 11, 2011 9:55 PM
  • Several responses from Microsoft.  But each one is "we are still looking into this..." 
    Monday, October 17, 2011 5:22 PM
  • OK - I think they found the answer.  It appears this is a problem in migration from version 4.0 to 2011.  The solution was to run this SQL UPDATE statement against my CRM database:

    update accountbase set merged=0 where merged is NULL

    After running this update I was able to deactivate accounts. 


    • Edited by dshradik Tuesday, October 18, 2011 5:24 PM
    • Proposed as answer by James Reinhardt Tuesday, May 15, 2012 4:01 PM
    • Marked as answer by dshradik Tuesday, May 15, 2012 6:20 PM
    Tuesday, October 18, 2011 5:24 PM
  • Can you put the whole query in here?


    Wednesday, October 19, 2011 8:56 PM
  • It's the same for ContactBase

    Update AccountBase set Merged = 0 where Merged is Null
    Update ContactBase set Merged = 0 where Merged is Null
    

    This two statements fixed the problems with deactivating Accounts und Contacts

    • Marked as answer by dshradik Tuesday, May 15, 2012 6:20 PM
    Monday, February 6, 2012 11:02 AM
  • Does anyone know what the "Merged" field does and why all of a sudden the values need to be set to '0' instead of 'NULL'?

    Thursday, March 1, 2012 9:50 PM