Results 1 to 3 of 3

Thread: How to change a field type

  1. #1
    codemaniac is offline Junior Member
    Join Date
    Aug 2010
    Posts
    2

    Default How to change a field type

    Using the Developer's Studio, I created a new module with several fields. It works great, but now I realize that I need to change one of the datatypes from an integer to a varchar. Sugar doesn't allow you to change a datatype. I thought I could just go directly into MySQL and change the datatype there, which I did, but the changes aren't reflected in Sugar.

    What can I do to change the datatype from Integer to Varchar?

  2. #2
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: How to change a field type

    You could always go back into module builder to delete the field and recreate it with the appropriate type. Of course, that assumes you don't have data in that module as of yet.

    Another option is to modify vardefs.php for the custom module and define the appropriate type there.
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  3. #3
    codemaniac is offline Junior Member
    Join Date
    Aug 2010
    Posts
    2

    Default Re: How to change a field type

    How do I modify the vardef file? Mine doesn't appear to have any information on the custom fields that I've created:

    $dictionary['UBKS1_BOOKS'] = array(
    'table'=>'ubks1_books',
    'audited'=>true,
    'fields'=>array (
    ),
    'relationships'=>array (
    ),
    'optimistic_lock'=>true,
    );
    require_once('include/SugarObjects/VardefManager.php');
    VardefManager::createVardef('UBKS1_BOOKS','UBKS1_B OOKS', array('basic','assignable'));

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Change text field type to dropdown
    By dsuvankar in forum Developer Help
    Replies: 3
    Last Post: 2010-01-11, 07:42 AM
  2. change custom field type
    By cwill in forum Developer Help
    Replies: 2
    Last Post: 2008-12-29, 01:30 PM
  3. How to change the type of a field?
    By ywingate in forum Help
    Replies: 6
    Last Post: 2008-08-14, 01:55 PM
  4. 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
  5. Replies: 1
    Last Post: 2007-05-01, 05:34 PM

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
  •