Hello.
I am creating some custom fields that get information from a related object, but there appears to be two ways of doing it, using either “relate” or “link” fields. For example:
$dictionary["WMSS1_Contact_Interested_In_Case"]["fields"]["wmss1_contact_interested_in_case_cases"] = array (
'name' => 'wmss1_contact_interested_in_case_cases',
'type' => 'link',
'relationship' => 'wmss1_contact_interested_in_case_cases',
'source' => 'non-db',
'module' => 'Cases',
'bean_name' => 'Case',
'vname' => 'LBL_WMSS1_CONTACT_INTERESTED_IN_CASE_CASES_FROM_CASES_TITLE',
'id_name' => 'wmss1_contact_interested_in_case_casescases_ida',
);
$dictionary["WMSS1_Contact_Interested_In_Case"]["fields"]["wmss1_contact_interested_in_case_cases_name"] = array (
'name' => 'wmss1_contact_interested_in_case_cases_name',
'type' => 'relate',
'source' => 'non-db',
'vname' => 'LBL_WMSS1_CONTACT_INTERESTED_IN_CASE_CASES_FROM_CASES_TITLE',
'save' => true,
'id_name' => 'wmss1_contact_interested_in_case_casescases_ida',
'link' => 'wmss1_contact_interested_in_case_cases',
'table' => 'cases',
'module' => 'Cases',
'rname' => 'name',
);
$dictionary["WMSS1_Contact_Interested_In_Case"]["fields"]["wmss1_contact_interested_in_case_casescases_ida"] = array (
'name' => 'wmss1_contact_interested_in_case_casescases_ida',
'type' => 'link',
'relationship' => 'wmss1_contact_interested_in_case_cases',
'source' => 'non-db',
'reportable' => false,
'side' => 'right',
'vname' => 'LBL_WMSS1_CONTACT_INTERESTED_IN_CASE_CASES_FROM_WMSS1_CONTACT_INTERESTED_IN_CASE_TITLE',
);
or
$dictionary["Email"]["fields"]["case_id"] = array (
'name' => 'case_id',
'type' => 'relate',
'dbType' => 'id',
'rname' => 'id',
'module' => 'Cases',
'id_name' => 'case_id',
'reportable' => false,
'vname' => 'LBL_WMSS1_CASE_ID',
'audited' => true,
'massupdate' => false,
);
$dictionary["Email"]["fields"]["case_name"] = array (
'name' => 'case_name',
'rname' => 'name',
'id_name' => 'case_id',
'vname' => 'LBL_WMSS1_CASE_NAME',
'type' => 'relate',
'link' => 'cases',
'table' => 'cases',
'join_name' => 'cases',
'isnull' => 'true',
'module' => 'Cases',
'dbType' => 'varchar',
'len' => 100,
'source' => 'non-db',
'unified_search' => true,
'importable' => 'required',
'studio' => true,
'inline_edit' => false,
);
I was wondering if anyone could explain the difference between the two approaches?
Thanks,
Carl