title: SugarCRM 7 SugarQuery() join statement with custom modules
body: <p>I'm trying to write a simple query in Sugar 7.2 that will join a table. This SQL is what I'm trying to create in the Sugar framework using SugarQuery(). </p>
  
  <pre><code>SELECT * FROM keyname_table_a LEFT JOIN keyname_table_b
  </code></pre>
  
  <p>So what I've created is the following. It works just fine when I use the core modules, but if I switch it to custom modules that we've created, Sugar logs me out and brings me to a login prompt. </p>
  
  <pre><code>$query = new SugarQuery();
  $query-&gt;from(BeanFactory::getBean('keyname_table_a'));
  $query-&gt;join('keyname_table_b');
  $results = $query-&gt;execute();
  
  return print_r($results, true);
  </code></pre>
  
  <p>The above logs me out and gives me the following error message in a popup message (similar to how app.alert.show works), and logs me out.</p>
  
  <pre><code>Error: Request failure, or, missing/invalid parameter. Please contact technical support
  </code></pre>
  
  <p>If I replace the "from" and "join" tables to be "Accounts" and "cases" respectively, then the query works just fine and pulls in the expected result. However, switching it to the custom modules that we have results in the above error and we are logged out instantly. </p>
  
  <p>I have verified that the relationship exists and there is data linking the two together. It is a one to many relationship in Sugar. <code>table_a</code> is one, while <code>table_b</code> is many.</p>
  
  <p>What is the proper way to join two custom modules with the <code>SugarQuery()</code> object?</p>