Results 1 to 6 of 6

Thread: Change type of default field

  1. #1
    Akayoko is offline Member
    Join Date
    Sep 2010
    Posts
    19

    Default Change type of default field

    Hi. I have a problem. It is necessary to change field type name module Cases with text on dropDown.I have added next lines at vardefs.php:
    PHP Code:
    $dictionary['Case']['fields']['name']['type'] = 'enum';
    $dictionary['Case']['fields']['name']['options'] = 'name_list'
    The field type changed, but in detailview heading undertakes from a field ' name ', i.e. key instead of value.
    How to make so that in heading 'value' was substituted?

    Thanks!

  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: Change type of default field

    What is your version?
    Where did you add this code?

    Regards
    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
    Akayoko is offline Member
    Join Date
    Sep 2010
    Posts
    19

    Default Re: Change type of default field

    Quote Originally Posted by andopes View Post
    What is your version?
    Where did you add this code?

    Regards
    Ver 6.2.1
    I edit custom/modules/cases/ext/vardefs/vardefs.ext.php
    PHP Code:
     // created: 2011-07-27 15:35:38
    $dictionary['Case']['fields']['name']['type'] = 'enum';
    $dictionary['Case']['fields']['name']['options'] = 'vid_konsultacii'

  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 type of default field

    You need to edit costom/Extension/modules/cases/ext/vardefs/vardefs.ext.php instead, then go to Admin -> Repair -> Quick Repair and Rebuild
    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.

  5. #5
    Akayoko is offline Member
    Join Date
    Sep 2010
    Posts
    19

    Default Re: Change type of default field

    Quote Originally Posted by andopes View Post
    You need to edit costom/Extension/modules/cases/ext/vardefs/vardefs.ext.php instead, then go to Admin -> Repair -> Quick Repair and Rebuild
    Sory, i edit custom/Extension/modules/cases/ext/vardefs/vardefs.ext.php too... And field type was changed, but in Title of detail view filed 'name' get 'key' from database. I need that in title fild 'name' get value from db...
    P.S. sorry for my english

  6. #6
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    782

    Default Re: Change type of default field

    I suggested two things:
    1. Use the value and text with the same value in your dropdown options defs. (But just if it is possible)
    2. Or, maybe the better solution, create a non-db field to be displayed in place of type field when it is displayed in detail view. Then this new non-db field could has its value computed, and display the correct text according with the stored value.
    Rafael Queiroz Gonçalves
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Computer Science Mastering / UFSC - PPGCC

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to change a field type
    By codemaniac in forum General Discussion
    Replies: 2
    Last Post: 2010-08-03, 10:47 PM
  2. How to change the type of a field?
    By ywingate in forum Help
    Replies: 6
    Last Post: 2008-08-14, 01:55 PM
  3. Modify data type of default field
    By jckit in forum Developer Help
    Replies: 2
    Last Post: 2008-07-17, 05:54 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: 2
    Last Post: 2007-07-11, 08: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
  •