So I have a query that allows me to choose all accounts from a specific state. I get this error "Warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/sales/sugar_im_report.php on line 73". When I run this query with any other field except address, it works just fine.
$query = "billing_address_state = 'CA'";
but If I change the query to
$query = "account_manager_c = 'AM'";
it works just fine.
Do I have to do something different with the state. When I run the query without the $query variable, I get and can display State with no problem.
$get_entry_list_parameters = array(
'session' => $session_id,
//The name of the module from which to retrieve records
'module_name' => 'Accounts',
//The SQL WHERE clause without the word "where".
'query' => $query,
//The SQL ORDER BY clause without the phrase "order by".
'order_by' => "account_manager_c ASC, name ASC",
//The record offset from which to start.
'offset' => '0',
//Optional. A list of fields to include in the results.
'select_fields' => array(
'link_name_to_fields_array' => array(
//The maximum number of results to return.
'max_results' => '50000',
//To exclude deleted records
'deleted' => '0',
//If only records marked as favorites should be returned.
'Favorites' => false,