Multi filter values in one string filter

Hi All,

What can I do this without using Query or parse string and do multi filters?

myfilter=“ABC,DEF,KLM”;

select myTable where myTable.myfield == myfilter;

I tried with like keyword without success. Any ideas?

Your query

select myTable
    where myTable.myfield == "ABC,DEF,KLM"

will do exactly what you asked it to do: it will find the record where MyField is “ABC,DEF,KLM”.

It seems that you want a completely different query:

select myTable
    where myTable.myfield == "ABC"
       || myTable.myfield == "DEF"
       || myTable.myfield == "KLM";

If you want to avoid parsing the string, make sure that you get the input as a collection and not a string.

Obviously if the number of elements can vary, you have to build the query dynamically using the Query class. I know you said you don’t want it, but you would give up the solution.

It will try to find a record/records with myField value as myFilter.

You can use || (OR) condition, it may be complex depending on the situation.

The best thing is to use the Query

Martin, It looks i am little slow in typing [:)]

Thank you all,

I thought maybe there is a way to use container. I don’t want to use query because using query usually harder than select/sql.

You talked about collection. Are you talking about collection class? I never used up collection class with AX. I’m not sure how I can use collection with select/sql command.

You really should get familiar with the query framework. It’s exactly what you need and you’re wasting your time by trying to avoid it.

It’s an extremely important part of AX development.