FilterService Find method

  • 12 March 2005
  • 4 replies
  • 1 view

Badge +1
I'm trying to filter on a Process Data field or Folio. I want the user to provide me a value (such as the document name) or Folio value and be able to get the Process Instance ID from that search in order to display the workflow status.

Below is my test code. Nothing is being returned in the dataset. What am I doing wrong?

string strXML = "<?xml version="1.0" encoding="utf-8" ?><Search><Criteria>CR-155</Criteria><Scope><Folio Search="True" /><Folder Search="False" /><ProcessName Search="False" /><ActivityName Search="False" /><EventName Search="False" /><ProcessData Search="True" /><ActivityData Search="True" /><Originator Search="False" /><Destination Search="False" /></Scope><Filter><DateFilter Filter="False"><FromDate /><ToDate /></DateFilter><ProcessFilter Filter="True"><Folder>ECM</Folder><Process>ECM</Process></ProcessFilter></Filter><Sort>Folio Asc</Sort></Search>";
System.Xml.XmlDocument findDoc = new System.Xml.XmlDocument();
findDoc.XmlResolver = null;
findDoc.LoadXml(strXML);

K2FilterService.FilterService wsK2 = new K2FilterService.FilterService();
wsK2.Credentials = new System.Net.NetworkCredential("username", "password", "domain");
System.Data.DataSet ds = wsK2.Find(findDoc, @"domainusername", 5);

4 replies

Badge +1
Nevermind. As soon as I changed the int param to 1 it worked.
Badge +13
How do you filter on just a specific DataField using FilterSearch/Find?

It seems that the Criteria will look for any of the categories that you allow it to search and not on a specific DataField. If there are 2 datafields named:
FirstName and LastName and I want to get all LastName=YAO, I don't want the search to come back when FirstName=YAO.
Badge +5
Michelle,

I'm having the same issue as you. What param did you change to 1?
Badge +1
Hello,
The last one. (5)
This parameter is the PageNo (Page Number).

How do you know how many pages are there in the result?
I am doing the same find feature and want to build up correct paging.

Reply