AnsweredAssumed Answered

sugarQuery Unknown Error (4096)

Question asked by Adrian Dinu on Jul 22, 2015
Latest reply on Jul 23, 2015 by Adrian Dinu
I'm trying this simple sugarQuery code:

// WARNING: The contents of this file are auto-generated.
//Merged from custom/Extension/application/Ext/Utils/currency_list.php

if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); 

$sq = new SugarQuery();
$bean = BeanFactory::newBean('Accounts');
$sq->from($bean, array('team_security' => false));
$result = $sq->execute();

The error I'm getting is:
Unknown Error (4096): Argument 1 passed to SugarQuery::from() must be an instance of SugarBean, null given, called in /var/www/sugar_fever/custom/application/Ext/Utils/custom_utils.ext.php on line 15 and defined occurred in

So it seems BeanFactory::newBean('Accounts') is returning null. Anyone knows why that could be? I also tried with other modules and no luck. I tried including data/SugarBean.php and data/BeanFactory.php but nothing changed. I'm new to Sugar development so forgive me if this is basic stuff. 
I'm on version Enterprise edition.