title: getBeans() for a relationship returns empty array
body: <p>I am creating a custom ACL class that would check whether the relationship exists between the records and if so load all the related records to that particular bean. I have looked at the sugar documentation which says to use <code>load_relationship($relationshipName)</code> for checking if relationship exists and <code>getBeans()</code> to load all the related records (as an array of objects). I have implemented this into my class but for some reason whichever module and relationship I use it always returns an empty array. </p>
  
  <p>The data I use for checking has 3 parts:</p>
  
  <ol>
  <li>The Module accessing the data</li>
  <li>The relationship name with the target module (not module name)</li>
  <li>The ID of the record accessing the data</li>
  </ol>
  
  <p>The link <a href="https://community.sugarcrm.com/thread/28292" rel="nofollow noreferrer">here</a> at sugar community shows a similar problem that I'm having, but the answer to this does not so solve my problem</p>
  
  <p>Here is my custom ACL:</p>
  
  <pre><code>namespace Sugarcrm\Sugarcrm\custom\clients\base;
  
  class CustomACL
  {
      const ACL_NONE = 0;
      const ACL_READ_ONLY = 1;
      const ACL_READ_WRITE = 2;
  
      public static function checkRelated($module, $linkedRelationshipName, $id)
      {
          $bean = \BeanFactory::getBean($module);
          if ($bean-&gt;load_relationship($linkedRelationshipName)) {
              return self::checkRecordRelated($bean, $id,$linkedRelationshipName);
          } else {
              return false;
          }
      }
  
      /**
       * Checks if record is related
       * @param $bean
       * @param $id
       * @param $linkedModule
       * @return bool
       */
      protected static function checkRecordRelated($bean, $id, $linkedModule)
      {
          $bean-&gt;retrieve_by_string_fields(array(
              "id" =&gt; $id
          ));
          if ($bean-&gt;load_relationship($linkedModule)) {
              $relatedRecords = $bean-&gt;$linkedModule-&gt;getBeans();
              return $relatedRecords;
          } else {
              return false;
          }
      }
  
  }
  </code></pre>
  
  <p>This class should be working for any module, even if it is custom or non custom. I have tried using my custom module and even the default modules (leads, accounts etc) but none of them returns anything except an empty array.</p>