Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

ClubQuery with several OR for one custom attribute



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

May 04, 2011 7:15

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.

May 04, 2011 9:15

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

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.