I have the following code imbeded in a K2 button I used for putting a worklist item to sleep.
//Declare the Worklist Object and WorklistItem Object
SourceCode.K2ROM.Worklist oWorklist;
//Open the Worklist (Current User, Platform: ASP)
oWorklist = oK2Connection.OpenWorklist("ASP");
foreach(SourceCode.K2ROM.WorklistItem oWorklistItem in oWorklist)
{
if(oWorklistItem.ProcessInstance.Folio == itemOrdNo)
{
oWorklistItem.Release();
oWorklistItem.Sleep(true,intTime);
}
This code works for "itemOrdNo"=anyitem in the worklist(except for the current opened order) The problem as stated, is that whenever "itemOrdNo" = currently opened item in workspace, the item does not changes its status to sleep. It just maintains its current status(Opened or Available). What am I missing here? I want to put the currently opened item in my worklist to sleep. Please help. I have been working on this functionality for days already.