Results 1 to 3 of 3

Thread: Can you change field types?

  1. #1
    Altstatten is offline Sugar Community Member
    Join Date
    Jan 2008
    Posts
    26

    Default Can you change field types?

    Can I change a field after an initial list import, from a text field to a drop-down field? If so, how might that be accomplished?
    Phillip Crum
    Chief Idea Officer
    MarketingMeasure/Sir Speedy Printing and Marketing Services
    Dallas, TX 75229
    pcrum@MarketingMeasure.com
    http://www.MarketingMeasure.com

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Can you change field types?

    Hi Phillip

    You can create an extended vardefs: custom/Extension/modules/<ModuleName>/Ext/Vardefs/vardefs.ext.php

    Into this file update the attribute which defines the type of the current field.

    PHP Code:
    $dictionary[<ClassName>]['fields'][]<FieldName>['type'] = 'varchar'
    Save this file (I believe you need to create the folders and the file), go to Admin -> Repair
    And click on "Rebuild Extension" and "Repair Database"

    This way the field will be automatically altered from dropdown to varchar.

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    Altstatten is offline Sugar Community Member
    Join Date
    Jan 2008
    Posts
    26

    Default Re: Can you change field types?

    Thank you!
    Phillip Crum
    Chief Idea Officer
    MarketingMeasure/Sir Speedy Printing and Marketing Services
    Dallas, TX 75229
    pcrum@MarketingMeasure.com
    http://www.MarketingMeasure.com

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 19
    Last Post: 2011-04-22, 09:24 PM
  2. How do I change a field to "list box" ?
    By endrejob in forum Help
    Replies: 2
    Last Post: 2008-09-12, 10:33 PM
  3. Is it a bug? Change the type of a custom field
    By ToniFatec in forum Developer Help
    Replies: 0
    Last Post: 2008-05-06, 03:17 PM
  4. Replies: 1
    Last Post: 2007-05-01, 05:34 PM
  5. Replies: 0
    Last Post: 2006-02-15, 08:31 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
  •