Registrations are now open. Join us today!
There is still a lot of work to do on the wiki yet! More information about editing can be found here.
Already have an account?

Microsoft KB Archive/925115

From BetaArchive Wiki
Knowledge Base

Error messages when you work with a campaign activity in Microsoft Dynamics CRM 3.0: "Deletion Service failed to clean up some tables" or "Record is unavailable"

Article ID: 925115

Article Last Modified on 8/15/2007


  • Microsoft Dynamics CRM 3.0


When you work with a campaign activity in Microsoft Dynamics CRM 3.0, you may experience one of the following problems:

  • When you delete a campaign activity that has distributed activities and corresponding campaign responses, you do not receive an error message. However, the following event is logged in the Application log on the computer that is running the server components of Microsoft Dynamics CRM 3.0:

    Source: MSCRMDeletionService
    Category: None
    Event ID: 16387
    Description: Error: Deletion Service failed to clean up some tables.

  • When you open a campaign response and then click the link for the originating activity, you receive the following error message if the originating activity has already been deleted:

    Record is unavailable. The record you are requesting is currently unavailable. Either the record was not found or you do not have sufficient security permissions to view it.

    If the DevErrors parameter is enabled, the following information is also logged in the Web.config file:

    Server Error in '/' Application. Server was unable to process request.

    Description: An unhandled exception occurred during the cuexecution of the current web request. Please review the stack trace for more information about the error.

    Exception Details: System.Web.Services.Protocols.SoapExeception: Server was unable to process request.

    Source Error: An unhandled exception was generated durin the execution of the current web request. Information reqarding the origin and location of the exception can be identified using the exception stack trace below."

    Stack Trace: [SoapException: Server was unable to process request.] System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +1496 System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +217 Microsoft.Crm.Platform.Proxy.PhoneCallWebService.Retrieve(Guid id, ColumnSetBase columnSet) +100 Microsoft.Crm.Application.SMWrappers.PhoneCall.OMRetrieve(Guid id, ColumnSet columnSet) +55 Microsoft.Crm.Application.SMWrappers.ObjectBase.OMRetrieve(Guid id) +34 Microsoft.Crm.Application.SMWrappers.ObjectBase.InternalRetrieve(String id, String columnSet) +72 Microsoft.Crm.Application.Platform.ActivityBase.InternalRetrieve(String id, String columnSet) +25 Microsoft.Crm.Application.Platform.Entity.Retrieve(String columnSet) +125 Microsoft.Crm.Application.Forms.AppForm.RaiseDataEvent(FormEventId eventId) +212 Microsoft.Crm.Application.Forms.EndUserForm.Initialize(Entity entity) +56 Microsoft.Crm.Application.Forms.CustomizableForm.Execute(Entity entity, String formId, String formType) +83 Microsoft.Crm.Application.Forms.CustomizableForm.Execute(Entity entity) +13 Microsoft.Crm.Web.Activities.BasicActivityPage.ConfigureForm() +196 Microsoft.Crm.Application.Controls.AppPage.OnPreRender(EventArgs e) +30 System.Web.UI.Control.PreRenderRecursiveInternal() +62 System.Web.UI.Page.ProcessRequestMain() +1499

    If you view the Microsoft CRM Platform Error Report, the report contains the following error message:

    Error Description: The specified object was not found.
    Error Details: Not Available
    Error Number: 0x80040217
    Source File: Not Available
    Line Number: Not Available
    Request URL: http://URL

    Note The request URL in the error message will vary depending on the type of activity that was involved when the error message occurred.


These problems may occur because the Deletion Service cannot delete some records from the ActivityPointerBase table. The records cannot be deleted because the records reference other records that still exist.

When you try to delete a campaign activity, Microsoft CRM tries to delete distributed activities. This occurs because Microsoft CRM is configured to delete all the campaign activities and all the distributed activities that have relationships with a campaign activity when you delete that campaign activity. This problem also occurs because distributed activities are related to campaign responses. The relationship between distributed activities and campaign responses keeps the distributed activities from being deleted. Therefore, the Deletion Service is unsuccessful.


To resolve these problems, clean up the ActivityPointer table. To clean up the ActivityPointer table, locate all the activities that have relationships with the campaign activity that you want to delete. Then, update the related fields so that the activities no longer have relationships with the campaign activity. Then, locate the campaign responses. Change the originating activity field of the campaign responses so that the campaign responses are no longer linked to the activity that is linked to the campaign activity.

To find the records that have a relationship with the originating activities that no longer exist in Microsoft Dynamics CRM 3.0, run the following query against the MSCRM database in SQL Query Analyzer or in SQL Server Management Studio.


  • You must have administrator privileges to run the query so that you can see all the records that may have originating activities that no longer exist.
  • The query displays the campaign, the campaign response, and the campaign response subject for each record that has an originating activity that no longer exists.
SELECT Fcr.regardingobjectidname as 'Campaign Name',
Fcr.originatingactivityname as 'CampaignResponse Name',
Fcr.subject as 'Campaign Response Subject'
FROM [FilteredCampaignResponse] Fcr
WHERE OriginatingActivityId in (SELECT [ActivityId] 
                FROM [ActivityPointerBase] 
                WHERE DeletionStateCode='2')

You can use the information that you receive from the query together with an Advanced Find query to open the campaign responses that have to be changed. To create the Advanced Find query, follow these steps:

  1. In Microsoft CRM, click Advanced Find.
  2. On the Find tab, click Campaign Responses in the Look for box.
  3. In the Use Saved View box, click All Campaign Responses.
  4. Point to Select, and then click Parent Campaign (Campaign).
  5. Point to Select, and then click Campaign Activities (Parent Campaign).
  6. Point to Select, and then click Activities (Regarding).
  7. Point to Select, and then click Activity. Point to Equals, and then click Contains Data.
  8. Click Find.
  9. Open the campaign responses that were returned.
  10. Change the originating activity by using the lookup button next to the originating activity. Change the originating activity to an activity that still exists.
  11. Save the changes.

The next time that the Deletion Service runs, the records that were marked for deletion will be deleted.


If you want to keep the originating activity name the same for archive purposes in Microsoft Dynamics CRM 3.0, you can safely close the error messages.


For more information about the DevErrors parameter in the Web.config file, click the following article number to view the article in the Microsoft Knowledge Base:

857192 How to modify the Web.config file to show more detailed error messages in Microsoft CRM

Additional query words: crm3 crm30 crm3.0 CRM 3.0 deletion service record unavailable 0x80040217

Keywords: kbtshoot kberrmsg kbmbsmigrate kbprb KB925115