You are here

Maintaining

Deleting workflow logs using the SDK

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

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

Subscribe to Maintaining