ClubQuery with several OR for one custom attribute

Vote:
 

Hello

I'm performing a query as follows:

StringCriterion sCrit = new StringCriterion();
sCrit.Value = myValue;
clubQuery["MyCustomAttribute"] = sCrit;

 

for a field that I've added. This works perfectly, however, there are cases where I want to specify several possible values for MyCustomAttribute.

I know you can use CriteriaGroup for several different fields, but how do I do it for the same attribute?

The result I want is "MyCustomAttribute IN ('X', 'Y', 'Z')".

If anyone could lend me a hand here I'd much appreciate it.

// Kristian

#50487
May 04, 2011 7:15
Vote:
 

Instead of setting sCrit.Value you should be able to set sCrit.Inclues = new StringInCriterion() and then add the values you want to search for in that.

#50497
May 04, 2011 9:15
Vote:
 

Lovely, just what I was looking for. I owe you my life :)

#50499
May 04, 2011 9:47
This thread is locked and should be used for reference only. Please use the Legacy add-ons forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.