0

How can I sort the workflow history on time? I got the workflow and workflow history programmatically, but I cannot order by date descending?

Get Workflow and History:

Sitecore.Workflows.WorkflowEvent[] workflowHistory = master.WorkflowProvider.GetWorkflow(workFlowItem).GetHistory(workFlowItem);
foreach (Sitecore.Workflows.WorkflowEvent work in workflowHistory)
{
  var comments += work.CommentFields["Comments"]
}

Kindly Assist,

0
Sitecore.Workflows.WorkflowEvent[] workflowHistory = master.WorkflowProvider.GetWorkflow(workFlowItem).GetHistory(workFlowItem);
foreach (Sitecore.Workflows.WorkflowEvent work in workflowHistory.OrderByDescending(x => x.Date)) 
{ 
  var comments += work.CommentFields["Comments"] 
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.