Reputation: 75
Good day.
I want to add field that should contain link to related some module item, but modules can changes.
For example, this field that I need should be at Accounts and should contains links to Calls, Emails, Meetings etc objects. And I can choose module and object like
How to do this field?
Upvotes: 0
Views: 105
Reputation: 3950
[note: This was written before the question was tagged with 'suitecrm'. While SuiteCRM is based on SugarCRM CE 6.5, there are many differences between their current versions, so not everything stated below might apply to SuiteCRM.]
That field type is called flex relate
field.
In regular Sugar each module can only have one field of that type.
It is saved in the database as parent_type
(containing the linked module's name) and parent_id
(containing the linked record's id).
The modules you can choose from are defined by the dropdown list parent_type_display
and can be changed there.
(The list's values are supposed to be the modules' technical name as seen in the URL and database fields; its labels can be anything).
If you want different lists available in different modules, you can do that via code by overriding the list name in the options
attribute of each modules parent_type
field's VarDefs.
Instructions on how to create flex relate fields in Module Builder and Studio can be found in the official documentation: https://support.sugarcrm.com/Knowledge_Base/Studio_and_Module_Builder/Creating_a_Flex_Relate_Field/
Upvotes: 1