title: SugarCRM Relate a Case to a Contact record through API?
body: <p>I am using the SugarCRM API and I need to create a <code>Case</code> and then <code>Relate</code> it to a <code>Contact</code> record.  I have tried many combination of the code3 below and kept getting a r esult back saying no record was created for my relationship.</p>
  
  <p>I finally changed it and I now get the result back saying a record is created.  The problem is when I view the Case inside SugarCRM or the Contact record, neither of them show up in each others SubPanels as if the relationship was not created!</p>
  
  <p>I am also using the REST API wrapper from here <a href="https://github.com/asakusuma/SugarCRM-REST-API-Wrapper-Class/" rel="nofollow">https://github.com/asakusuma/SugarCRM-REST-API-Wrapper-Class/</a></p>
  
  <p>My code to relate the Case to a Contact...</p>
  
  <pre><code>$module_name = 'Cases';
  $module_id = $caseID;
  $link_field_name = 'contacts'; // Also tried 'contacts_cases' which Fails in the result
  $related_ids = array('741c9e89-7f45-62e1-9490-524b21a6ea4f');//John Doe contact record 
  
  
  $results = $sugar-&gt;set_relationship($module_name, $module_id, $link_field_name, $related_ids);
  
  echo '&lt;pre&gt;';
  print_r($results);
  echo '&lt;/pre&gt;';
  </code></pre>
  
  <p>The output from this is...</p>
  
  <pre><code>Array
  (
      [created] =&gt; 1
      [failed] =&gt; 0
      [deleted] =&gt; 0
  )
  </code></pre>
  
  <p>So you can see from my output, it appears the records are related, however when viewing the records inside SugarCRM I cannot see a relation on either modules record.  Any ideas what might be going wrong here?</p>