문제

I have customized workbox by overriding it. By default Workbox displays all versions of items in a particular workflow state. I need only the last version to appear in the workbox. Played around with the DisplayStates(IWorkflow workflow, XmlControl placeholder) method, but no luck.

How can I do this?

도움이 되었습니까?

해결책

You need to override DisplayStates() method and filter the DataUri[] items array:

List<DataUri> filteredUriList = new List<DataUri>();
DataUri[] items = this.GetItems(state, workflow);

for (int index = offset; index < num; ++index)
{
    Item obj = Sitecore.Context.ContentDatabase.Items[items[index]];
    if (obj != null && obj.Versions.IsLatestVersion())
        filteredUriList.Add(items[index]);
}
items = filteredUriList.ToArray();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top