Results 1 to 8 of 8

Thread: Changing field length of standard fields

  1. #1
    pmazolo is offline Member
    Join Date
    May 2010
    Posts
    13

    Default Changing field length of standard fields

    Hi,
    I want to extend the length of Task Name field to more than 50 chars. I notice that is not possible from within Sugar, but I could do it in MySQL....

    Would it have any effect?

    Would I risk causing bugs?

    Any other way to do it? I want to Use he standard field as this is what is visible all over Sugar...

    Rgds
    PM

  2. #2
    datasponge is offline Sugar Community Member
    Join Date
    Mar 2008
    Location
    San Jose, CA, USA
    Posts
    552

    Default Re: Changing field length of standard fields

    Don't change it in MySQL as it will be out of sync with vardefs.

    Instead create an Extension that changes the length, then a Quick Repair and Rebuild will update it in the database.

    Create a file <sugar_root>/custom/Extension/modules/Tasks/Ext/Vardefs/custom.php with the following contents:

    PHP Code:
      $dictionary['Task']['fields']['name']['len'] = '255'
    You can change the length to any value you like. Create any files in the path if needed.

    Then do a Quick Repair and Rebuild from the Admin Panel. Make sure you scroll all the way to the bottom of the results page and look for an Alter Table query. Sometimes you have to click the Execute button to complete the modification of the MySQL table to be in sync with vardefs.

    Phil

  3. #3
    Niggy is offline Sugar Community Member
    Join Date
    Oct 2008
    Posts
    255

    Default Re: Changing field length of standard fields

    I have done this for $dictionary['Contacts']['fields']['salutation']['len']=>20;

    ... but it did not work. Any suggestions?
    Ubuntu Apache/2.2.11 (Debian) PHP/5.3 MySQL 5.5

    My Blog

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

    Default Re: Changing field length of standard fields

    Quote Originally Posted by Niggy View Post
    I have done this for $dictionary['Contacts']['fields']['salutation']['len']=>20;

    ... but it did not work. Any suggestions?
    'Contacts' should be 'Contact'

    And like Phil said, make sure you do a Quick Repair and Rebuild aftewards.
    Regards,

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

  5. #5
    Cedric K is offline Senior Member
    Join Date
    Sep 2010
    Posts
    155

    Default Re: Changing field length of standard fields

    Hello

    And if you put a string instead of an int ? I did that customization few weeks ago and it worked fine.

  6. #6
    Niggy is offline Sugar Community Member
    Join Date
    Oct 2008
    Posts
    255

    Default Re: Changing field length of standard fields

    Sorted - it should have been $dictionary['Contact']['fields']['salutation']['len']='20';
    Ubuntu Apache/2.2.11 (Debian) PHP/5.3 MySQL 5.5

    My Blog

  7. #7
    Neil_Weston is offline Member
    Join Date
    Mar 2011
    Posts
    9

    Default Re: Changing field length of standard fields

    Have followed this thread, as I have a similar problem with the 'Title" field in 'Employees'.

    I think the length is only around 25 chars at the moment and I want to increase it up to 50.

    I have created a custom.php document with the line;

    $dictionary['Employees']['fields']['title']['len'].=.'50';

    Problem is, when I go to upload it into <sugar_root>/custom/Extension/modules/Tasks/Ext/Vardefs/custom.php - that path does not exist in my installation.

    The only similar path that I have is; <sugar_root>/custom/modules/Tasks/metadata/

    which takes me to a file called 'popupdefs.php'

    Does this mean that within the 'custom' directory I have to create a new path called 'Extension/modules/Tasks/Ext/Vardefs/' in order to load my custom.php file into the new 'Vardefs' directory?

    Sorry if this seems obvious, but I am new to this app and just don't want to do anything that may 'break' my installation.

    I am using Version 6.1.2 (Build 5555).

    Thanks kindly

  8. #8
    horus77 Guest

    Default Re: Changing field length of standard fields

    Quote Originally Posted by Neil_Weston View Post
    Have followed this thread, as I have a similar problem with the 'Title" field in 'Employees'.

    I think the length is only around 25 chars at the moment and I want to increase it up to 50.

    I have created a custom.php document with the line;

    $dictionary['Employees']['fields']['title']['len'].=.'50';

    Problem is, when I go to upload it into <sugar_root>/custom/Extension/modules/Tasks/Ext/Vardefs/custom.php - that path does not exist in my installation.

    The only similar path that I have is; <sugar_root>/custom/modules/Tasks/metadata/

    which takes me to a file called 'popupdefs.php'

    Does this mean that within the 'custom' directory I have to create a new path called 'Extension/modules/Tasks/Ext/Vardefs/' in order to load my custom.php file into the new 'Vardefs' directory?

    Sorry if this seems obvious, but I am new to this app and just don't want to do anything that may 'break' my installation.

    I am using Version 6.1.2 (Build 5555).

    Thanks kindly
    I'm trying to do similar with a custom firl - url type field - max is 255 - and i want 700

    I've tried what you mentioned here but no joy....

    ie $dictionary['Lead']['fields']['linkedin_search']['len']='700';

    was created in custom.php (created file)

    in location:

    /custom/Extension/modules/Leads/Ext/Vardefs/custom.php

    What should I do?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Changing a Standard Text Field to a Dropdown
    By L_Moss in forum Developer Help
    Replies: 0
    Last Post: 2009-12-24, 04:47 PM
  2. changing standard relationships
    By monicaDC in forum Help
    Replies: 2
    Last Post: 2009-06-22, 03:04 PM
  3. Changing length of day?
    By greenleaf in forum Installation and Upgrade Help
    Replies: 2
    Last Post: 2007-01-17, 07:02 PM
  4. Changing Varchar length
    By eaho in forum Help
    Replies: 4
    Last Post: 2006-09-05, 08:32 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
  •