Results 1 to 2 of 2

Thread: Custom dropdown field help needed

  1. #1
    stompnoise is offline Member
    Join Date
    Sep 2010
    Posts
    12

    Default Custom dropdown field help needed

    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.

  2. #2
    davidboris is offline Sugar Community Member
    Join Date
    May 2010
    Posts
    1,113

    Default Re: Custom dropdown field help needed

    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.

    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); 
    Place the code in view.edit.php and put the field in editviewdefs.php.
    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. country dropdown using custom field
    By s0me1 in forum Developer Help
    Replies: 8
    Last Post: 2011-10-25, 03:30 PM
  2. Custom field direction needed
    By dmetelski in forum Developer Help
    Replies: 0
    Last Post: 2010-07-29, 06:25 PM
  3. Help needed - making a custom field in contacts
    By randypif in forum Developer Tutorials
    Replies: 1
    Last Post: 2010-03-03, 11:33 AM
  4. Replies: 2
    Last Post: 2008-05-06, 09:44 AM
  5. Custom Field - Dropdown
    By mnaish in forum Help
    Replies: 3
    Last Post: 2005-03-28, 02:37 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •