• SugarQuery Having Max(datefield) < xxxx-xx-xx

    Hi, I need to create a query which selects contacts which only having cases older then one year. I managed to create a working MySQL query, but how to convert it to a SugarQuery? Anyone any experience with this type of query? MySQL SELECT contacts…
  • Sugarquery - Dynamic Select Statement Failing

    Hi team. I am trying to build a dynamic SugarQuery, the scenario is that I have an array of "fields" I want to use to create a dynamic select statement. For simplicity the $selectGenerator array below contains name and id. $sugarQuery = new SugarQuery…
  • suddenly get auto logged out from Sugar with a status of 412 (Precondition Failed)

    Hi, I just got auto looged out SugarCRM. Then I see the browser console, I found an error in some Rest API https://xyz.com/rest/v11_10/Contacts?erased_fields=true&view=list&fields=lead_source%2Cfollowing%2Cmy_favorite&max_num=20…
  • Why are all these fields selected when I only want id

    Why are all the fields in TASKS selected here when I am only asking for id? This is my code <?php /** * @param string $parent_id * @param string $type * @param array $status * @param string $subject * @param bool $billing * @return bool|false…
  • SugarQuery N-Deep Join Issue

    I tried the N-Deep join from https://developer.sugarcrm.com/2014/04/22/sugarcrm-cookbook-sugarquery-the-basics/ but it seems to be not working. did anything changed in Sugar 7.7 $query = new SugarQuery(); $query->from(BeanFactory::getBean('Accounts')…
  • How can I use joinTable properly?

    Hi there. I am making a custom sub panel to display accounts that are related to an opportunity but are't the paying account There is a custom 1 to many relationship from Accounts to Opportunities In opportunities there is a custom field which is a related…
  • SugarQuery Joinraw alternative for email related tables

    For a customer we are in the process of upgrading from 7.6.x to 7.9.3. Many things have changed over the time and therefore we face lots of issues. One of these issues that we are facing is the depcrecation of the joinRaw() function on SugarQuery. In…
  • Is there a way to do a left join with SugarQuery()?

    I would like the join highlighted below to be a left join so the TCX_ProductMappings record is always returned regardless of whether or not there is a linked TCX_Product record. $Query = new SugarQuery(); $Query->from(BeanFactory::getBean('TCX_ProductMappings…
  • SugarQuery with a Where clause field LIKE '%58%'

    I have a field in my DB, it is type INT. Lets call it test_int so <?php $query = new SugarQuery ( ) ; $query - > from ( BeanFactory : : getBean ( 'Accounts' ) ) ; $query - > select ( array ( 'id' , 'name' , 'test_int' ) ) ; $query - > where ( ) - > contains…
  • Simple SugarQuery using a custom field returns no results

    I created a custom Integer field called ticket_id_c in the Cases module and I can clearly see the field having the value my code is looking for in the cases_cstm table, but I still get no results. $sq = new SugarQuery ( ) ; $sq - > select ( 'id' ) ; …