locked
Unable to delete relationship RRS feed

  • Question

  •  

    I am unable to delete an N:1 relationship b/w a system entity and a custom entity.
    When I try to do it it throws the following error :
     An error has occured.
     
    I have removed the attribute form all the Forms and Views. the only thing I could think of why I was unable to delete the relationship is the mapping that relationship has.

    It has the mapping which when I delete throws the following error:
     One or more of the attribute maps could not be deleted because they are being used by Microsoft dynamics CRM.
     
    This is the error that is recorded in the Trace:

     

     

    Code Snippet

    Process: w3wp |Organization:27fd3555-f3d2-4ca4-829f-53aa56cb04ce |Thread:   11 |Category: Application |User: 00000000-0000-0000-0000-000000000000 |Level: Error | ErrorInformation.LogError
     at ErrorInformation.LogError()
     at ErrorInformation..ctor(Exception exception, Uri requestUrl, Boolean logError)
     at ErrorInformation..ctor(Exception exception, Uri requestUrl)
     at AppWebService.CreateSoapException(Exception innerException)
     at SystemCustomization.DeleteRelationship(Guid relationshipId)
     at RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
     at RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
     at RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
     at RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
     at LogicalMethodInfo.Invoke(Object target, Object[] values)
     at WebServiceHandler.Invoke()
     at WebServiceHandler.CoreProcessRequest()
     at SyncSessionlessHandler.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 HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)
     at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)
    >MSCRM Error Report:
    --------------------------------------------------------------------------------------------------------
    Error: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

    Error Message: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

    Source File: Not available

    Line Number: Not available

    Request URL: http://localhost:5555/JuiceEnergy/AppWebServices/SystemCustomization.asmx

    Stack Trace Info: [SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.]
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command)
       at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate)
       at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command)
       at Microsoft.Crm.Metadata.SqlHelper.ExecuteNonQuery(MetadataHelper helper, IDbCommand sqlCommand)
       at Microsoft.Crm.Metadata.RelationshipDeleteAction.RemoveRelationshipFromDatabase(RelationshipDeleteInfo deleteInfo, MetadataHelper helper)
       at Microsoft.Crm.Metadata.EntityRelationshipDeleteAction.DatabaseOperation()
       at Microsoft.Crm.Metadata.MetadataHelper.ProcessQueue()
       at Microsoft.Crm.Metadata.RelationshipService.Delete(Guid entityRelationshipId, ExecutionContext context)
       at Microsoft.Crm.Metadata.RelationshipServiceBase.Delete(Guid entityRelationshipId)
       at Microsoft.Crm.Metadata.EntityRelationshipService.Delete(Guid entityRelationshipId)
       at Microsoft.Crm.Application.WebServices.SystemCustomization.RelationshipDelete.Execute(IUser user, Guid entityRelationshipId)
       at Microsoft.Crm.Application.WebServices.SystemCustomization.SystemCustomization.DeleteRelationship(Guid relationshipId)

     

     

     

    I have one more N:1 relationship in this system entity. This entity releationship is with itself. I am unable to delete the same and facing the same problem as stated above. It also has a mapping that I am unable to delete...throwing the same error.

     

    --Rahul

    MCTS - Windows Applications .NET Framework 2.0

    Friday, August 22, 2008 7:24 AM

Answers

  •  

    No...the relationship was was restrict delete type.

     

    Neways thanks...its done...i reverted back to the previous state on VPC...i.e. state before performing these deleting actions.

     

    Finally figued out what was wrong. Actully I had multiple relationships between three entities refering each other...just following the right sequence to delete...it was done...

    Friday, August 22, 2008 2:34 PM

All replies

  • What is the relationship cascading type between those entities?

    The error you posted indicates a timeout. There must be an earlier error indicating something more specific.

     

    Adi

     

    Friday, August 22, 2008 8:16 AM
  •  

    No...the relationship was was restrict delete type.

     

    Neways thanks...its done...i reverted back to the previous state on VPC...i.e. state before performing these deleting actions.

     

    Finally figued out what was wrong. Actully I had multiple relationships between three entities refering each other...just following the right sequence to delete...it was done...

    Friday, August 22, 2008 2:34 PM