The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.
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"
);
dynamicModuleManager.SaveChanges();
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"
);
dynamicModuleManager.SaveChanges();
Stanislav Velikov is a Tech Support Engineer at Telerik. He joined the Sitefinity Support team in April 2011.
Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.
Learn MoreSubscribe to get all the news, info and tutorials you need to build better business apps and sites
Progress collects the Personal Information set out in our Privacy Policy and the Supplemental Privacy notice for residents of California and other US States and uses it for the purposes stated in that policy.
You can also ask us not to share your Personal Information to third parties here: Do Not Sell or Share My Info
We see that you have already chosen to receive marketing materials from us. If you wish to change this at any time you may do so by clicking here.
Thank you for your continued interest in Progress. Based on either your previous activity on our websites or our ongoing relationship, we will keep you updated on our products, solutions, services, company news and events. If you decide that you want to be removed from our mailing lists at any time, you can change your contact preferences by clicking here.