Unable to use multiple filters in esq query in client side modules

When I try to implement esq and multiple filters, only last added filter will work. Rest will be kind of overrided by the next filter.

For example, If I use 3 filters - 


esq.filters.add(esqFirstFilter);
esq.filters.add(esqSecondFilter);
esq.filters.add(esqThirdFilter);

I am getting results on the basis of last filter.

If I use 2 filters - 

 

esq.filters.add(esqFirstFilter);
esq.filters.add(esqSecondFilter);

 

Then last filter esqSecondFilter will filter the records not the first one. And I need both filters.

Is there anything need to be added to this code snippet - before or after.

 

Like 0

Like

1 comments

Dear Ramnath,

 

In order to resolve the issue please use the following code for adding filters:

 

esq.filters.add("esqFirstFilter", esqFirstFilter);

esq.filters.add("esqSecondFilter", esqSecondFilter);

 

Please find more information about esq filters in the article by the link below:

 

https://academy.creatio.com/documents/technic-sdk/7-16/entityschemaquery-class-filters-handling

 

Best regards,

Norton

Show all comments