Searching for a work box owned by a team

The following code example creates a simple query using the WBQuery class in order to search for WBs within a WBC that belong to the given team. Under the hood the WBF converts this code into a CAML query that is executed against the SPList holding the WB metadata for the WBC.

WBTaxonomy teams = WBTaxonomy.GetTeams(SPContext.Current.Site);
WBTeam financeTeam = teams.GetSelectedTeam(“Islington Council/Finance”);

using (WBCollection collection = new WBCollection("http://collection/foi"))
    WBQuery query = new WBQuery();
    query.AddEqualsFilter(WBColumn.OwningTeam, financeTeam);

    foreach (WorkBox workBox in collection.GetWorkBoxes(query))
        // ... do something with the work box object


This query is also used here: Using WBQuery to create a DataTable to bind to an SPGridView

Last edited May 8, 2014 at 12:17 AM by OliSharpe, version 6


No comments yet.