Thank you…now i can see my custom field, but it is always reporting me a database failure and the log doesn’t show anything:
<?php
$dictionary['Case']['fields']['case_parent_name'] = array(
'required' => true,
'source' => 'non-db',
'name' => 'case_parent_name',
'vname' => 'Refering to',
'type' => 'parent',
'massupdate' => 0,
'comments' => '',
'help' => '',
'importable' => 'true',
'duplicate_merge' => 'disabled',
'duplicate_merge_dom_value' => '0',
'audited' => false,
'reportable' => true,
'len' => 25,
'size' => '20',
'options' => 'my_custom_flex_case_options',
'studio' => 'visible',
'type_name' => 'case_parent_type',
'id_name' => 'case_parent_id',
'case_parent_type' => 'my_custom_flex_case_options',
);
$dictionary['Case']['fields']['case_parent_type'] = array(
'required' => true,
'name' => 'case_parent_type',
'vname' => 'LBL_CASE_PARENT_TYPE',
'type' => 'parent_type',
'massupdate' => 0,
'comments' => '',
'help' => '',
'importable' => 'true',
'duplicate_merge' => 'disabled',
'duplicate_merge_dom_value' => 0,
'audited' => false,
'reportable' => true,
'len' => 255,
'size' => '20',
'dbType' => 'varchar',
'studio' => 'hidden',
);
$dictionary['Case']['fields']['case_parent_id'] = array(
'required' => true,
'name' => 'parent_id',
'vname' => 'LBL_CASE_PARENT_ID',
'type' => 'id',
'massupdate' => 0,
'comments' => '',
'help' => '',
'importable' => 'true',
'duplicate_merge' => 'disabled',
'duplicate_merge_dom_value' => 0,
'audited' => false,
'reportable' => true,
'len' => 36,
'size' => '20',
);
$dictionary['Case']['fields']['accounts'] = array(
'name' => 'accounts',
'type' => 'link',
'relationship' => 'Case_accounts',
'module'=>'Accounts',
'bean_name'=>'Account',
'source'=>'non-db',
'vname'=>'LBL_ACCOUNTS',
);
$dictionary['Case']['fields']['contacts'] = array(
'name' => 'contacts',
'type' => 'link',
'relationship' => 'Case_contacts',
'module'=>'Contacts',
'bean_name'=>'Contact',
'source'=>'non-db',
'vname'=>'LBL_CONTACTS',
);
$dictionary['Case']['fields']['employees'] = array(
'name' => 'employees',
'type' => 'link',
'relationship' => 'Case_employees',
'module'=>'Employees',
'bean_name'=>'Employee',
'source'=>'non-db',
'vname'=>'LBL_EMPLOYEES',
);
$dictionary['Case']['relationships']['Case_accounts'] = array(
'lhs_module' => 'Case',
'lhs_table' => 'Case',
'lhs_key' => 'case_parent_id',
'rhs_module' => 'Accounts',
'rhs_table' => 'accounts',
'rhs_key' => 'id',
'relationship_type' => 'one-to-many',
'relationship_role_column'=>'case_parent_type',
'relationship_role_column_value'=>'Accounts'
);
$dictionary['Case']['relationships']['Case_contacts'] = array(
'lhs_module' => 'Case',
'lhs_table' => 'Case',
'lhs_key' => 'case_parent_id',
'rhs_module' => 'Contacts',
'rhs_table' => 'contacts',
'rhs_key' => 'id',
'relationship_type' => 'one-to-many',
'relationship_role_column'=>'case_parent_type',
'relationship_role_column_value'=>'Contacts'
);
$dictionary['Case']['relationships']['Case_employees'] = array(
'lhs_module' => 'Case',
'lhs_table' => 'Case',
'lhs_key' => 'case_parent_id',
'rhs_module' => 'Employees',
'rhs_table' => 'employees',
'rhs_key' => 'id',
'relationship_type' => 'one-to-many',
'relationship_role_column'=>'case_parent_type',
'relationship_role_column_value'=>'Employees'
);
If i put this code in a different module other than Case it works....so there's some interaction with existing "Account Name" field...
but not able to understand why....
Any hint?
Thank you