<div dir="ltr">Check include/Webservices/VTQL_Parser.php<br><div><br></div><div>Line 106:</div><div><br></div><div>/*<br>add this rule to add parenthesis support.<br>condition ::= PARENOPEN expr_set expr(E) PARENCLOSE.<br>sample format(for contacts) for generated sql object <br>Array ( <br>   [column_list] => c4,c3,c2,c1 <br>      [tableName] => vtiger_crmentity,vtiger_contactdetails,vtiger_contactaddress,vtiger_contactsubdetails,vtiger_contactscf,vtiger_customerdetails <br>     [where_condition] => Array ( <br>              [column_operators] => Array ( <br>                     [0] => = <br>                  [1] => = <br>                  [2] => = <br>                  ) <br>            [column_names] => Array ( <br>                 [0] => c1 <br>                 [1] => c2 <br>                 [2] => c3 <br>                 ) <br>            [column_values] => Array ( <br>                        [0] => 'llet me' <br>                  [1] => 45 <br>                 [2] => -1 <br>                 ) <br>            //TO BE DONE<br>          [grouping] => Array (<br>                      [0] => Array (<br>                             [0] => 1<br>                           [1] => 2<br>                           )<br>                     )<br>             [operators] => Array ( <br>                    [0] => and <br>                        [1] => or <br>                 )<br>             )<br>     [orderby] => Array ( <br>              [0] => c4 <br>         [1] => c5 <br>         )<br>     [select] => SELECT <br>        [from] => from <br>    [semi_colon] => ; <br>)*/<br></div><div><br></div><div>Parenthesis is not supported by default, but might be the mentioned change could do the trick.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 6, 2020 at 5:18 PM nilay khatri <<a href="mailto:nilay.spartan@gmail.com">nilay.spartan@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I don't think  grouped where clauses are supported.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 6, 2020 at 2:50 PM Alan Lord <<a href="mailto:alanslists@gmail.com" target="_blank">alanslists@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I need to use vtws_query but when I include parenthesis like this I get <br>
an error:<br>
<br>
         $query = "SELECT id, name, status, assigned_user_id<br>
                   FROM LSModule<br>
                   WHERE (status = 'Active' OR status = 'Development')<br>
                   AND tgt_module = '".$moduleName."';";<br>
<br>
<br>
<br>
> Mon Apr  6 09:08:59 2020,529 [28641] DEBUG VT - Syntax Error on line 1: token '(' Unexpected PARENOPEN((), expected one of: COLUMNNAME<br>
<br>
If I remove the parenthesis the query runs but I am not then sure if the <br>
result as actually what I want, e.g. how are the OR and AND clauses <br>
interpreted?<br>
<br>
Cheers<br>
<br>
Al<br>
<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a><br>
</blockquote></div>
</blockquote></div>