Hi, I am trying to get worlist using
worklist = cnn.OpenWorklist(criteria);
The criteria is to get worklist items with ( (Status=0 or Status=1) and Owner=Me) or ( Status=0 and Owner=Other).
I tried something below.
criteria.AddFilterField(WCLogical.StartBracket, WCField.None, WCCompare.Equal, null);
criteria.AddFilterField(WCLogical.StartBracket, WCField.WorklistItemStatus, WCCompare.Equal, 0);
criteria.AddFilterField(WCLogical.Or, WCField.WorklistItemStatus, WCCompare.Equal, 1);
criteria.AddFilterField(WCLogical.AndBracket, WCField.WorklistItemOwner, "Me", WCCompare.Equal, WCWorklistItemOwner.Me);
criteria.AddFilterField(WCLogical.Or, WCField.None, WCCompare.Equal, null);
criteria.AddFilterField(WCLogical.StartBracket, WCField.WorklistItemOwner, "Other", WCCompare.Equal, WCWorklistItemOwner.Other);
criteria.AddFilterField(WCLogical.AndBracket, WCField.WorklistItemStatus, WCCompare.Equal, 0);
criteria.AddFilterField(WCLogical.EndBracket, WCField.None, WCCompare.Equal, null);
I get an exception Incorrect syntax near ')'.
After some reading on google, I found that
criteria.AddFilterField(WCLogical.StartBracket, WCField.WorklistItemOwner, "Other", WCCompare.Equal, WCWorklistItemOwner.Other);
doesnt not ork if the criteria is using the lines
criteria.AddFilterField(WCLogical.StartBracket, WCField.None, WCCompare.Equal, null);
criteria.AddFilterField(WCLogical.EndBracket, WCField.None, WCCompare.Equal, null);.
Id ont understnd the relation between these peices of code. but when I remove the above lines, WCWorklistItemOwner.Other works fine. Is this a design flaw/bug with K2 API.
Can some one help me achive the criteria ( (Status=0 or Status=1) and Owner=Me) or ( Status=0 and Owner=Other)