Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Workflow History not able to fetch

$
0
0

Dear All,

I have develop a SharePoint 2013 Designer workflow which has Workflow history and Task List.

I need to display Workflow History in custom WebPart. I am using below code however I am shock when i debug the code 

SPSite site = new Site (Site Url)

SPWeb web = site.OpenWeb();

SPListItem item = web.Lists[ABC].GetListITembyID(ID);

if(item != null)

{

if(item.Workflows.Count > 0)  // <- Workflow Count is zero :(:(

{

SPListItemCollection itemcoll = item.Workflows[0].HistoryList.Items;

}

}



Regards, Sachin


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>