It’s a repaired field type. This field type was also in the previous versions, i…ncluding SugarCRM ver.6…, but it was broken. This field type can be used to include in one object a lot of records from another object. It’s for using only standard algorithm which SuiteCRM has.
## Description
This upgrade change files:
include/SugarFields/Fields/Collection/CollectionDetailViewRow.tpl include/SugarFields/Fields/Collection/CollectionEditViewRow.tpl include/SugarFields/Fields/Collection/DetailView.tpl include/SugarFields/Fields/Collection/EditView.tpl include/SugarFields/Fields/Collection/SugarFieldCollection.php include/SugarFields/Fields/Collection/ViewSugarFieldCollection.php jssource/src_files/include/SugarFields/Fields/Collection/SugarFieldCollection.js
This upgrade includes:
- making data and form in backend;
- controlling data in frontend form;
- saving data in backend.
## Motivation and Context
It’s an easy mechanism to make dynamic groups of fields for system or customer modules.
## How To Test This
This decision can be tested if the customer module install (https://github.com/pkonetskiy/BF_Connects_for_SuiteCRM). After installing you should change system or customer files:
- modules/Contacts/vardefs.php , add fields:
```
…
'fields'=>
array(
…
'bf_connects' => array (
'name' => 'bf_connects',
'type' => 'link',
'relationship' => 'bf_connects_contacts_collection',
'module'=>'BF_Connects',
'bean_name'=>'BF_Connects',
'source'=>'non-db',
'vname'=>'LBL_BF_CONNECTS_COLLECTION',
),
'collection_bf_connects' => array (
'name' => 'collection_bf_connects',
'type' => 'collection',
'source'=>'non-db',
),
),
…
```
- modules/Contacts/metadata/editviewdefs.php and modules/Contacts/metadata/ quickcreatedefs.php, add lines:
```
…
'tabDefs' =>
array(
…
'LBL_PANEL_CONNECTS' => array(
'newTab' => false,
'panelDefault' => 'expanded',
),
),
…
'panels'=>
array(
…
'lbl_panel_connects' => array (
0 => array (
0 => array (
'name' => 'bf_connects',
'type' => 'collection',
'displayParams' => array (
'collection_field_list' => array(
array(
'name' => 'title',
'displayParams' => array (
'size'=>'20%',
),
),
array(
'name' => 'address_link',
'displayParams' => array (
'size'=>'30%',
),
),
array(
'name' => 'attribute',
'displayParams' => array (
'size'=>'5%',
),
),
array(
'name' => 'description',
'displayParams' => array (
'size'=>'35%',
),
),
),
),
),
),
),
),
…
```
- modules/Contacts/metadata/detailviewdefs.php, add lines:
```
…
'tabDefs' =>
array(
…
'LBL_PANEL_CONNECTS' => array(
'newTab' => false,
'panelDefault' => 'expanded',
),
),
…
'panels'=>
array(
…
'lbl_panel_connects' => array (
0 => array (
0 => array (
'name' => 'bf_connects',
'label'=>'LBL_BF_CONNECTS_COLLECTION_DETAILVIEW',
'type' => 'collection',
'displayParams' => array (
'collection_field_list' => array(
array(
'name' => 'title',
'displayParams' => array (
'size'=>'20%',
),
),
array(
'name' => 'address_link',
'displayParams' => array (
'size'=>'30%',
),
),
array(
'name' => 'attribute',
'displayParams' => array (
'size'=>'15%',
),
),
array(
'name' => 'description',
'displayParams' => array (
'size'=>'35%',
),
),
),
),
),
),
),
),
…
```
- modules/Contacts/language/en_us.lang.php, add lines:
```
…
'LBL_PANEL_CONNECTS'=>'Connects',
'LBL_BF_CONNECTS_COLLECTION' => 'Connects: <br>Add new or Delete selection',
'LBL_BF_CONNECTS_COLLECTION_DETAILVIEW' => 'Connects',
…
```
## Types of changes
- [X] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
### Final checklist
- [X] My code follows the code style of this project found [here](https://docs.suitecrm.com/community/contributing-code/coding-standards/).
- [X] My change requires a change to the documentation.
- [X] I have read the [**How to Contribute**](https://docs.suitecrm.com/community/contributing-code/) guidelines.