AnsweredAssumed Answered

Is there way to name a relationship something other than accounts_contacts_2?

Question asked by Amy Cox on May 18, 2015
Latest reply on May 19, 2015 by Amy Cox
After spending hours and hours trying to find why there was a custom relationship between a Contact and a Account I have realized how important it is to find a way to call a relationship or a side of a relationship something else.  For example: If we want to get all the Notes for a Contact we run $contact->load_relationship('notes').  I want to be able to do the same for colleges a student is thinking about transferring to (College a type of Account).  So I could say $contact->load_relationship('transfer_college') to load the College or Colleges they are thinking about transferring to after attending our Community College.

Right now the vardef in the Contact side says:
// created: 2012-10-30 16:19:49
$dictionary["Contact"]["fields"]["accounts_contacts_2"] = array (
   'name' => 'accounts_contacts_2',
   'type' => 'link',
   'relationship' => 'accounts_contacts_2',
   'source' => 'non-db',
   'id_name' => 'accounts_contacts_2accounts_ida',
$dictionary["Contact"]["fields"]["accounts_contacts_2_name"] = array (
   'name' => 'accounts_contacts_2_name',
   'type' => 'relate',
   'source' => 'non-db',
   'save' => true,
   'id_name' => 'accounts_contacts_2accounts_ida',
   'link' => 'accounts_contacts_2',
   'table' => 'accounts',
   'module' => 'Accounts',
   'rname' => 'name',