This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - Searching for item on multiple conditions

handpuppet - Friday, July 17, 2015 4:04 PM:

I have the following code that searches for two conditions on an item.  If I just search for one condition, say just Approved, it works.  But when I search for BOTH Approved and Incorporated, it does not work.  Anyone have an idea how I would say "search where the status is Incorporated OR status is Approved"?  The search is attempting to search where the status is BOTH equal to Incorporated and equal to Approved.

 

this.setProperty("status", "Incorporated, Approved");

this.setPropertyCondition("status", "eq");

return this;



RobMcAveney - Friday, July 17, 2015 4:14 PM:

Try this:

orItem.setProperty("status", "'Incorporated', 'Approved'");
orItem.setPropertyCondition("status", "in");
return this;

Note the single quotes around the values and the condition of "in", not "eq".

Rob



handpuppet - Monday, July 20, 2015 8:14 AM:

This solution worked.  Thank you very much!

The other condition I have to search on is where the property data type is an ItemType and the data source is an Item Type itself.  I attempted the above solution for this case but it did not return any search results.  Since the condition for the property status by itself worked, I know that the second condition is causing the issue.