Master To Web
Sitecore, Workflows

Sitecore WorkflowCounters namespace change

Recently, I was reading a post on how to change the workflow state of Sitecore items programmetically and noticed that I could not compile the example code in later versions of Sitecore.

Specifically, the following line in the example code was failing:

if (pipeline != null)
{
    WorkflowCounters.ActionsExecuted.IncrementBy(pipeline.Processors.Count);
}

To fix the problem, simply replace the problematic line with the new namespace for the same action:

if (pipeline != null)
{
    Sitecore.Diagnostics.PerformanceCounters.DataCount.WorkflowActionsExecuted.IncrementBy((long)pipeline.Processors.Count);
}

Related posts

HOW TO: Save user information (or any additional data) when a user submits a Sitecore form

Amir Setoudeh
2 years ago

Easily search for text in any field with this Sitecore Powershell Extensions Report

Amir Setoudeh
2 years ago

Authenticode issuer Error when attempting to install Sitecore 10.4 via the Sitecore Installation Assistant

Amir Setoudeh
12 months ago
Exit mobile version