Results 1 to 3 of 3

Thread: Setting Custom Field Formatting in DetailView

  1. #1
    beuten is offline Sugar Community Member
    Join Date
    May 2006
    Location
    Berlin, Germany
    Posts
    151

    Default Setting Custom Field Formatting in DetailView

    We have several numeric custom fields in various modules. I would like to display them in the DetailViews as currency values using the default settings.

    I have been able to get most of them showing correctly by updating the /sugar/custom/modules/xxxxxx/metadata/listviewdefs.php file (see below). This is generally used for the ListViews, which also has the side-effect that it updates the formatting for the DetailView as well. The problem is that not all the currency values are shown in the ListView. If 'defaul' => false is set, then it does not show up in the ListView and my formatting is wrong in the DetailView (as with DISTRIBUTIONPRICE_C below)

    Any ideas??

    'COST_PRICE' =>
    array (
    'width' => 10,
    'label' => 'LBL_COST_PRICE',
    'default' => true,
    'align' => 'right',
    'related_fields' =>
    array (
    0 => 'currency_id',
    ),
    'currency_format' => true,
    ),

    'DISTRIBUTIONPRICE_C' =>
    array (
    'width' => 10,
    'label' => 'Distribution_Price__c',
    'default' => false,
    'align' => 'right',
    'related_fields' =>
    array (
    0 => 'currency_id',
    ),
    'currency_format' => true,
    ),
    Chad (beuten)
    DAXTEN
    www.daxten.com

  2. #2
    beuten is offline Sugar Community Member
    Join Date
    May 2006
    Location
    Berlin, Germany
    Posts
    151

    Default Re: Setting Custom Field Formatting in DetailView

    Can anyone help
    Last edited by beuten; 2007-04-18 at 08:30 PM.
    Chad (beuten)
    DAXTEN
    www.daxten.com

  3. #3
    sloose is offline Junior Member
    Join Date
    Mar 2007
    Posts
    1

    Default Re: Setting Custom Field Formatting in DetailView

    Hi beuten,

    I'm a newbie when it comes to sugarCRM and PHP, but I have done the following to get what I think you want.

    In the editview.php for your module (in my case sugarcrm\modules\opportunities\editview.php) after the lines

    //Add Custom Fields
    require_once('modules/DynamicFields/templates/Files/EditView.php');

    Add the following

    $xtpl->assign("SALE_COST_PART1_C",currency_format_number ($focus->sale_cost_part1_c));

    This code should probably be added as a logic_hook to make upgrades easier, but I haven't figured out to create these correctly yet.

    I hope this helps.

    Stuart

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. custom field to sugar field
    By tanhaa in forum Developer Help
    Replies: 2
    Last Post: 2011-05-04, 03:52 PM
  2. Asterisk Patch 1.1.0 Crash on logon
    By skyracer in forum Help
    Replies: 6
    Last Post: 2006-07-08, 06:30 AM
  3. Replies: 7
    Last Post: 2006-06-06, 07:56 PM
  4. Replies: 3
    Last Post: 2005-10-21, 05:28 PM
  5. Custom Field Issue still lingering
    By rengstrom in forum General Discussion
    Replies: 9
    Last Post: 2005-06-07, 07: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
  •