Group Criteria and Query API
Does anyone know how to add bracketed groupings to a query API script? For instance, this query criteria, as it would to a user in web client, returns the exception “Workflow.Duration must be used in a group criteria that contains only Cover Page.Status with IN operator as an additional criteria”. In the web client, you add brackets to the left and right side of the criteria to group them, but I can’t seem to get that same sort of thing to work in the query API.
query.setCriteria(“[Cover Page.Status] in (‘Default Change Orders.CCB Review’) and [Workflow.Duration] > ‘2160’”);
Does anyone know how to get the above query to work?
Hi madhusudanas,
Using parentheses in that way instead like so gives me the error “Cant support nested workflow search criteria grouping.”
query.setCriteria(“([Cover Page.Status] in (‘Default Change Orders.CCB Review’) and [Workflow.Duration] > ‘2160’)”);
Does anyone know the escape character for brackets? Is that what I’m missing?
Can you please try the following. I removed the braces for ‘Default Change Orders.CCB Review’
query.setCriteria(“([Cover Page.Status] in ‘Default Change Orders.CCB Review’ and [Workflow.Duration] > ‘2160’)”);
I’m afraid that received the same error message: “Cant support nested workflow search criteria grouping.”
Odd, huh? There’s no documentation on how to do this in the API guide.
And to think that this advanced search works just fine but recreating the same thing as an IQuery does not.
Matt Paulhus
Note that the first obvious fix, as seen below, returns a syntax error (at position 95):
query.setCriteria(“[[Cover Page.Status] in (‘Change Notice Workflow.CCB Review’) and [Workflow.Duration] > ‘2160’]”);