Results 1 to 8 of 8

Thread: Customize account_type field

  1. #1
    joomlaman is offline Senior Member
    Join Date
    Feb 2009
    Posts
    25

    Default Customize account_type field

    I am using SugarCRM Community 5.2.0a .

    How can I customize the account_type so that it accepts multiple values rather than a single value via a dropdown? It seems I must create a custom field via an override PHP file, but I am at a loss as to what the code should be, and where to put it, and which file(s) must be overridden so that the field is 'working as intended', i.e., the search is not broken, the display in list and edit is not broken, etc.

    Thanks.

  2. #2
    daniel.passarini's Avatar
    daniel.passarini is offline Sugar Community Member
    Join Date
    Apr 2006
    Location
    São Paulo - SP / Brasil
    Posts
    80

    Default Re: Customize account_type field

    you have to set the field type to multienum
    you can do this by creating/editing custom/Extensions/modules/Accounts/Ext/Vardefs/my_customization.php and overriding the field type ins this file.
    Aftare that, Rebuild Extensions
    Daniel de Carvalho Passarini

    "Fascinating" - Dr. Spock

  3. #3
    joomlaman is offline Senior Member
    Join Date
    Feb 2009
    Posts
    25

    Default Re: Customize account_type field

    I created the following file:

    PHP Code:
    <?php
       $dictionary
    ['Accounts']['fields']['account_type']['type'] = 'multienum';
    ?>

    I dropped this file in:

    /home/myserver/www/ops/custom/Extension/modules/Accounts/Ext/Vardefs

    After rebuilding, it appears nothing happened. Is the location wrong, or the code wrong, or both?

    EDIT
    I do see the file rebuilt into
    /home/myserver/www/ops/custom/modules/Accounts/Ext/Vardefs/vardefs.ext.php

    So the code must be incorrect.
    Last edited by joomlaman; 2009-02-12 at 07:05 PM.

  4. #4
    daniel.passarini's Avatar
    daniel.passarini is offline Sugar Community Member
    Join Date
    Apr 2006
    Location
    São Paulo - SP / Brasil
    Posts
    80

    Default Re: Customize account_type field

    Hi joomlaman

    only one detail.. change Accounts to Account

    it's a common mistake
    Daniel de Carvalho Passarini

    "Fascinating" - Dr. Spock

  5. #5
    joomlaman is offline Senior Member
    Join Date
    Feb 2009
    Posts
    25

    Default Re: Customize account_type field

    Thanks for your help. Now I have a new problem

    The field is rendering fine with the old sample values, but if I go in and edit an account, and specify any amount of types, it saves the account_type field in the database as 'Array'.

    In firebug, when I inspect the post:

    account_type[] Analyst
    account_type[] Customer
    account_type_multiselect true
    action Save
    Last edited by joomlaman; 2009-02-12 at 08:11 PM. Reason: More info

  6. #6
    joomlaman is offline Senior Member
    Join Date
    Feb 2009
    Posts
    25

    Default Re: Customize account_type field

    After some additional forum search I found the solution

    http://www.sugarcrm.com/forums/showthread.php?t=36855

    $dictionary['Account']['fields']['account_type']['isMultiSelect'] = true;

    I don't understand why this works [I would think just making it multi enum is good enough], but it does.

  7. #7
    joomlaman is offline Senior Member
    Join Date
    Feb 2009
    Posts
    25

    Default Re: Customize account_type field

    Don't suppose anyone can explain why my "fix" worked? I would really like to learn, rather than just take guesses on everything. Thanks

  8. #8
    joomlaman is offline Senior Member
    Join Date
    Feb 2009
    Posts
    25

    Default Re: Customize account_type field

    Polite bump requesting any further explanation on why my 'fix' worked. Even a page reference in the documentation would be great for me. Thanks

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to customize field in crm(Make field mandatory)
    By sadique in forum Sugar Developer Website
    Replies: 8
    Last Post: 2009-09-03, 02:53 PM
  2. Replies: 0
    Last Post: 2008-11-03, 07:42 PM
  3. Replies: 1
    Last Post: 2008-09-05, 11:30 AM
  4. customize the way a field is displayed
    By cswilliams in forum Help
    Replies: 1
    Last Post: 2008-05-24, 03:54 PM
  5. customize field values
    By gesuina in forum Help
    Replies: 1
    Last Post: 2006-04-24, 03:22 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
  •