I need to create a new custom field of dropdown type. the problem is it will be a list of over 200 choices. is there a database table where I can just insert the values? thanks.
I need to create a new custom field of dropdown type. the problem is it will be a list of over 200 choices. is there a database table where I can just insert the values? thanks.
Hello,
Sugar manages drop downs as arrays in language files. But you can create a function based dropdowns as well. And you can create your own table and write custom code to fetch the values from that and assign to the drop down.
E.g.
Place the code in view.edit.php and put the field in editviewdefs.php.PHP Code:$customDropdown = "<select name='<FIELD_NAME>[]'>";
if(!empty($this->bean-><FIELD_NAME>))
$customDropdown .= get_select_options_with_id(<FUNCTION_WHICH_RETURNS_VALUES_AS_ARRAY>,$this->bean-><FIELD_NAME>);
else
$customDropdown .= get_select_options_with_id(<FUNCTION_WHICH_RETURNS_VALUES_AS_ARRAY>,'');
$customDropdown.="</select>";
$this->ss->assign("CUSTOMCODE_CUSTOMDROPDOWN", $customDropdown);
Thumbs up.
Skype ID - david__boris
SugarForge Projects:
WYSIWYG now in studio!(Version 1.1 is out now!)
Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.
Fab Tools! > Dashlet Not Followed Opportunities for past six Months
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks