Skip to main content
Worklist is returning no work item. I have verified that there are at least 4 workitem under the connected user.

I have tried getting worklistitem with the K2 serial Number. This return an error that no work item was found

I have tired openserveritem this return an error that no workitem was found.

here's the sample code that I used to get the worklist:
Dim oK2Connection As New K2ROM.Connection
Dim oWorkList As K2ROM.Worklist
Dim oWorkListItem As K2ROM.WorklistItem

'----------------------------------------------------------------------------------------------------------------------------------------
'Worklist for current Logged on user as specified in the Connection
'------------------------------------------------------------------------------------------------------------------------------------------------

'Open the Connection
oK2Connection.Open("TNSMIWCDPDEVNJ", "[;];Authentication=External;user=joeschmo;password=password")

'Get Worklist for current Logged on User
oWorkList = oK2Connection.OpenWorklist("ASP")

For Each oWorkListItem In oWorkList

'Update Process Data or XML Field
'MsgBox(oWorkListItem.SerialNumber.ToString())
oWorkListItem.ProcessInstance.DataFields("matchChaff").Value = "Yes"

oWorkListItem.Update()
Next

Any suggestions is greatly appreciated.
I think the worklist items are submitted further to the next step of the process and that particular user may not be the owner at that point of time. :idea:
Try the following, change your current For Each oWorkListItem In oWorkList Statement to the example below:

For Each oWorkListItem In oWorkList 
Remember to Declare CurrentWL
CurrentWL = oK2Connection.OpenWorklistItem(oWorkListItem.SerialNumber, "ASP )
CurrentWL.ProcessInstance.DataFields("matchChaff").Value = "Yes"

CurrentWL.Update()
Next


let me know

Reply