Change existing relate field to flex relate

Hello,
it would be possible to take an existing relate field(Account Name in case module) and convert it into a flax relate which i need to control the option value?

The choice should be:
-> Accounts
-> Contacts
-> Users /Employees

Or any other possible way to do it?
PLease see my screenshots

Thank you

Hi,
You can’t change this kind of relate field but because it’s account related.
flex is like parent_id and parent_type

But, you can do in config_ovverride.php : field Account Name not required.

 $sugar_config['require_accounts'] = false;

and create a flex related field by Studio or vardefs.
And you can change drop_down value as you will. (accounts, contacts, users, employees)

Regards

Thank you,
but how…?

I’ve tried following this link without success…maybe too old post.

http://developer.sugarcrm.com/2011/05/16/howto-create-a-flex-relate-for-other-modules/

And…if i remove from studio existing flex relate field and create my custom Accounts/Contacts/Users flex relate field, does this will have any impact on entire
case module management?

Thank you

Hi,
it’s correct.

You have juste to change :



    'parent_type' => 'my_custom_flex_case_options',  like this

$dictionary['Case']['fields']['parent_type'] = array(  like this, just i dont know if Case or Cases !?

$app_list_strings['my_custom_flex_case_options'] = array(   like this

Don’t forget quick repair and rebuild and go to bottom of page for ALTER Cases table… you must run the SQL Query
Then in Studio, put the new field in layout

Regards,

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

hi rainolf did u found a solution your issue?
I also want to know how to add multiple flex fields to editView… can someone help me in this regards