M.App Enterprise Discussions

Discuss topics with other M.App Enterprise Product pioneers and experts to get the most out of it.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Contributor
Posts: 28
Registered: ‎04-19-2018
Accepted Solution

Logical operator OR does not work in Entity.Filter

 

Hi guys,

 

If I use the logical operator OR to filter my entities in the Shell it dose not work correctly.

 

<Entity.Filters>  
     <Filter Id="EntidadesApp" Sql="ent_enable=1 OR ent_enable=0 " IsDefault="True" />
</Entity.Filters>

Instead If I use the operator AND it works well.

 

Why is that happening?

 

 

Thank you,

Regards

 

 

Elisa

 

Highlighted
Technical Evangelist
Posts: 1,182
Registered: ‎09-11-2015

Re: Logical operator OR does not work in Entity.Filter

[ Edited ]

Hi Elisa,

 

I've just tested filter queries like this and all of them worked fine:

Sql="sacc = 'IN' AND source = 'PP'"
(4 rows returned)
Sql="sacc = 'IN' OR sacc = 'AC'"
(8 rows returned)
Sql="(sacc = 'IN' OR sacc = 'AC') AND source = 'AMP'"
(2 rows returned)

I would recommend tracing the database queries and see what query makes it into the database. Then test this qurey for results.

 

Jan

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Highlighted
Contributor
Posts: 28
Registered: ‎04-19-2018

Re: Logical operator OR does not work in Entity.Filter and Working Areas

Hi!!

 

My problem solves with parenthesis

Sql="(sacc = 'IN' OR sacc = 'AC')

It's because I also are using working areas. This needs the parenthesis to get the correct filter.

 

Thank you!!

Elisa