Using addFoundSetFilterParam with IN operator

Hello,

I need to use a addFoundSetFilterParam on my foundset using the IN operator. The documentation says that this is possible, but it doesn’t work.

I need a filter on orderstatus where orderstatus = D or I
The following syntax I tried, also with quotes around D and I,
but none of these seem to work.

_foundset.addFoundSetFilterParam('salesorder_status', 'IN', '(D, I)');

also

_foundset.addFoundSetFilterParam('salesorder_status', 'IN', 'D, I');

doesn’t work good, but it returns the records with only status D

Anyone knows the exact syntax for using IN operator?

You should use an array containing your values:

_foundset.addFoundSetFilterParam('salesorder_status', 'IN', new Array('D', 'I'));

Perfect! That works

In such scenario’s, you can always check the exact queries fired at the database through the admin pages (performance log).

that will give you a good ide what is going on.

Paul