Results 1 to 4 of 4

Thread: change lead field data type

  1. #1
    dpt123 is offline Member
    Join Date
    Sep 2009
    Posts
    5

    Default change lead field data type

    Hi
    I created a lead field data field type as a text field, but realise it should be an integer.
    Its a number, a square meterage, and the problem occurs because users enter 123m instead of 123 and then I cannot do calculations on exported data because of the "m".

    Now that this has happened I need to either change the field type (and hopefully stop people entering an "m") or create a new field and have the old data transferred across.

    Any ideas?

  2. #2
    salesagility's Avatar
    salesagility is offline Sugar Community Member
    Join Date
    Aug 2006
    Location
    UK
    Posts
    2,379

    Default Re: change lead field data type

    Create a new field and transfer the data across.

  3. #3
    dpt123 is offline Member
    Join Date
    Sep 2009
    Posts
    5

    Default Re: change lead field data type

    Hi,
    I am concerned at losing data when I just "transfer it across" can you point me to a tutorial that lets me change a data type, or attributes of a field.

    For instance, I cannot click in the box that will make phone number a required field?

    Do I clone this field? will data come across automatically?

    Should I attempt to find the field in the database and change it there using PHPMYADMIN for instance.

  4. #4
    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: change lead field data type

    I am concerned at losing data when I just "transfer it across" can you point me to a tutorial that lets me change a data type, or attributes of a field.

    For instance, I cannot click in the box that will make phone number a required field?
    Once this is a custom field you should be able to configure this one as a required field!
    Anyway, you can add the attribute:
    PHP Code:
    'displayParams' => array(
      
    'required' => true,
    ), 
    Into field definition at editviewdefs.php

    Do I clone this field? will data come across automatically?
    No.

    Should I attempt to find the field in the database and change it there using PHPMYADMIN for instance.
    This is an option. You have to do the following:
    Update the table fields_meta_data to modify the field type of the given field;
    Alter the table <module_table>_cstm to modify the field type accordingly;
    Go to Admin -> Quick Repair and Rebuild.

    Obviously make a backup before.

    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.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Howto Change Custom Field Data Type
    By andreasw in forum General Discussion
    Replies: 9
    Last Post: 2011-10-12, 04:07 PM
  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: 0
    Last Post: 2006-06-10, 04:09 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
  •