Hi, you will need to re-create your custom field by vardefs by adding the file:
custom/Extension/modules/Accounts/Ext/Vardefs/field_market.php
with contents:
<?php
$dictionary['Account']['fields']['market'] = array (
'name' => 'market',
'vname' => 'LBL_MARKET',
'type' => 'enum',
'massupdate' => '1',
'importable' => 'true',
'duplicate_merge' => 'disabled',
'inline_edit' => true,
'reportable' => true,
'unified_search' => false,
'merge_filter' => 'disabled',
'len' => 60,
'options' => 'market_list',
);
and the file
custom/Extension/modules/Accounts/Ext/Language/en_us.field_market.php
with contents
<?php
$mod_strings['LBL_MARKET'] = 'Market';
To make this field available in ClientVisits you will need to create
custom/Extension/modules/cv_ClientVisits/Ext/Vardefs/field_account_market.php
with contents
<?php
$dictionary["cv_ClientVisits"]["fields"]["cv_clientvisits_accounts_name"]["join_link_name"] = "clientvisits_accounts_link";
$dictionary['cv_ClientVisits']['fields']['account_market'] = array (
'name' => 'account_market',
'rname' => 'market',
'id_name' => 'cv_clientvisits_accountsaccounts_ida',
'vname' => 'LBL_ACCOUNT_MARKET',
'join_name'=>'accounts',
'join_link_name'=>'clientvisits_accounts_link',
'type' => 'relate',
'link' => 'cv_clientvisits_accounts',
'table' => 'accounts',
'isnull' => 'true',
'module' => 'Accounts',
'dbType' => 'varchar',
'source' => 'non-db',
'unified_search' => true,
'massupdate' => false,
'studio' => array('detailview' => 'true'),
'inline_edit' => false,
'options' => 'market_list',
);
and the file
custom/Extension/modules/cv_ClientVisits/Ext/Language/en_us.field_account_market.php
with contents
<?php
$mod_strings['LBL_ACCOUNT_MARKET'] = 'Market';
Afterwards:
-
do a Admin / Repair / Quick Repair and Rebuild, donāt forget to scroll down and execute to query displayed at the bottom.
-
Make sure to create the dropdown list named āmarket_listā (or use an already existing) with admin / dropdown editor
-
Migrate field values from your previous custom field to your newly created field, by an SQL query, see for an example some posts above. Afterwards you can delete your previously created custom field in studio
Because the detailviews, filters and lists are not aware that this is a dropdown field, the following changes are needed to make sure the dropdown field is displayed correctly:
- After adding this field to the detailview of ClientVisits (studio), edit the file
custom/modules/cv_ClientVisits/metadata/detailviewdefs.php
in:
array (
'name' => 'account_market',
'type' => 'relate',
change ārelateā to āenumā
- After adding this field to your ClientVisits filters (studio), edit the file:
custom/modules/cv_ClientVisits/metadata/searchdefs.php
in:
'account_market' =>
array (
'type' => 'relate',
change ārelateā to āenumā
- After adding this field to your ClientVisits listview (studio), edit the file:
custom/modules/cv_ClientVisits/metadata/listviewdefs.php
in:
'ACCOUNT_MARKET' =>
array (
'type' => 'relate',
change ārelateā to āenumā
The listview does not yet support the display of dropdown fields from related modules, which will cause it to display the list names instead of the list labels.
PS: for future post, try out the preformatted text button when posting code, or start with [code] and end with [/code]