AnsweredAssumed Answered

Get_linked_beans only retrieves one record

Question asked by tanphat911 tanphat911 on Apr 23, 2014
Latest reply on May 2, 2014 by paperless
Hi every body, 

i try to using logic hook to get all related Contact from my custom Opportunity module to Client Module . Any i got some problems on function get_linked_beans(). As i know if will take all related record but in my situation it on get one record instead. Here is my code
function updateCompanyRelated(&$bean, $event, $arguments) { 
   require_once('modules/Contacts/Contact.php');                   require_once('modules/SCP_Opportunity/SCP_Opportunity.php');

  if ($arguments['related_module'] =='SCP_Opportunity')

  $opportunity = new SCP_Opportunity();
  //Get Relate company
  //Get Relate Contacts
  $contacts = $opportunity->get_linked_beans('scp_opportunity_contacts','Contact');
  foreach ($contacts as $contact) { 

And here is the result