Skip to Content
0

C4C SDK: Multiple values in query parameters

Nov 20, 2017 at 02:49 PM

97

avatar image

Hi experts,

I have a situation in a program and we need filter a parameter with several values .

Ex:

Customer, A; B; C;

In my Action we are put the next code:

if ( !this.zztipo_cliente.IsInitial()){

selectionParams.Add(query.zztipo_cliente, "I", "EQ", this.zztipo_cliente);

}

if ( !this.zztipo_cliente1.IsInitial()){

selectionParams.Add(query.zztipo_cliente, "I", "EQ", this.zztipo_cliente1);

}

if ( !this.zztipo_cliente2.IsInitial()){

selectionParams.Add(query.zztipo_cliente, "I", "EQ", this.zztipo_cliente2);

}

if ( !this.zztipo_cliente3.IsInitial()){

selectionParams.Add(query.zztipo_cliente, "I", "EQ", this.zztipo_cliente3);

}

But with this code the query only filter with the last value.

There are some posibities of make like

selectionParams.Add(query.zztipo_cliente, "I", "EQ", this.zztipo_cliente and zztipo_clietne2; zztipo_cliente3; zztipocliente4)

Regards.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
s sin Nov 22, 2017 at 09:50 AM
0

Hi Carlos,

I did not got your point exactyl, I havo a doubt that you want to use "OR" or "AND" but if you want to achieve this:
selectionParams.Add(query.zztipo_cliente, "I", "EQ", this.zztipo_cliente and zztipo_clietne2; zztipo_cliente3; zztipocliente4)

You can do like below:

selectionParams.Add(query.zztipo_cliente, "I", "EQ", this.zztipo_cliente);
selectionParams.Add(query.zztipo_cliente, "I", "EQ", this.zztipo_cliente2);
selectionParams.Add(query.zztipo_cliente, "I", "EQ", this.zztipo_cliente3);
selectionParams.Add(query.zztipo_cliente, "I", "EQ", this.zztipo_cliente4);
Var result = query.Execute(selectionParams);

This will check all conditions and exactly works as "AND"

Sin

Share
10 |10000 characters needed characters left characters exceeded