Maintaining

Forcing CRM to clean up deleted records

  • Posted on: 17 June 2008
  • By: feridun

CRM 4.0 tidies up deleted records via the asynchronous service every 24 hours. To force an immediate cleanup follow the steps:

1. Mark the database to run the deletion tidy up immediately by running the following SQL commands. Take care to update the correct deletion service if your CRM server hosts multiple organizations.

USE MSCRM_CONFIG

Deleting workflow logs using the SDK

  • Posted on: 27 May 2008
  • By: feridun

To delete workflow logs using the SDK use the RetrieveMultiple and Delete messages.

Set up a query expression that defines which workflow logs to delete. For example, to delete workflow logs older than a certain date:

// set the columns to be returned
ColumnSet cols = new ColumnSet();
cols.Attributes = new string[] { "createdon", "description" };

// Create the on or before condition
ConditionExpression dateCondition = new ConditionExpression();
dateCondition.AttributeName = "createdon";

Clearing Workflow History

  • Posted on: 23 May 2008
  • By: feridun

There is no way to bulk clear out workflow history via the CRM application. It is possible to delete entries under Settings | System Jobs but that is restricted to a set number of records at a time (i.e. the number of records shown in a list view).

In Microsoft Dynamics CRM 4.0 workflow history is stored in two tables called asyncoperationbase and workflowlogbase. Details of all jobs that have run (whether workflow initiated or not) are stored in the asyncoperationbase table. For workflows, asyncoperationbase has one entry.

Pages