More in this section
Blogs RSS feed

Workflow Rejection for Dynamic Module Items Using the Sitefinity API

by Stanislav Velikov

When moving Sitefinity module builder items through the workflow, the standard method used is to call.

It is the extension method SetWorkflowStatus which allows you to state the status of each item to Published, Draft, AwaitingApproval, AwaitingPublishing, Rejected.

dynamicItem.SetWorkflowStatus(testsItem, dynamicModuleManager.Provider.ApplicationName, "Published");


The case with rejected, however, doesn`t support the addition of a rejection reason when rejecting an item sent for approval through code. While this is available through the UI and the rejection reason can be added, using SetWorkflowStatus doesn`t support it.

For this purpose until this feature is implemented and SetWorkflowStatus supports addition of a rejection reason, you can use the custom class that can be downloaded from here and provides customization of the SetWorkflowStatus method.

To use the class, call the static method  IWorkflowExtensionsCustom. SetWorkflowStatus

IWorkflowExtensionsCustom.SetWorkflowStatus(testsItem, dynamicModuleManager.Provider.ApplicationName, "Rejected",new CultureInfo("fr"),"rejection reason: fix spelling");


1 comment

Leave a comment
  1. Scott Rozman May 06, 2014

    Hello Stanislov-

    I was using a version of the custom class you shared above, but now with 7.0 the ApprovalTrackingRecordMap is obsolete.

    (Hope I typed that correctly. I cannot paste into this comment!)

    Is there a simpler do this / would you be willing to update this custom class?

    thanks in advance.

    Leave a comment