AnsweredAssumed Answered

queryAnd() and queryOr() in the same query

Question asked by Kenneth Brill on May 26, 2017

I am writing a SugarQuery and it goes like this

 

          $query = new SugarQuery();
          $query->from(BeanFactory::getBean('Orders'), array('team_security' => false));
          $accounts = $query->join('orders_accounts', array('team_security' => false))->joinName();
          $query->select(array(array('orders.id', 'orderID')));

          $query->where()->queryOr()
                      ->equals("orders_cstm.order_type_c", "System 1")
                      ->equals("orders_cstm.order_type_c", "System 2");

          $query->where()->queryAnd()
                 ->equals("$accounts.id", $accountID)
                 ->equals("orders.close_est", 100);

When it runs the SQL from the QueryAnd section is there but the SQL from the queryOr section is not .   What am I doing wrong ?

Outcomes