Custom Tax and Currency fields on Account

Dear Sugar Users, 

I'm attempting to add two custom fields to our Accounts. These are: 

  • Tax Rates
  • Currency

As neither of these fields can be added via the Relate data type in studio, i.e. they are not in the list of available modules, I have had to add them via a vardefs.ext.php file in "\custom\Extension\modules\Accounts\Ext\Vardefs\".

I have used a solution found here: Angel's Blog: SugarCRM Customization: Employees Relate Field (cheleguanaco.blogspot.com)

I have been able to add both fields.  The Tax Rate works as expected, i.e. can add and edit on an Account.

However the Currency filed is visible but not editable. (See below)

Below is my vardefs.ext.php file 

<?php


$dictionary["Account"]["fields"]["taxrate_name_c"] = array (
    'required' => false,
    'source' => 'non-db',
    'name' => 'taxrate_name_c',
    'vname' => 'Taxrates',
    'type' => 'relate',
    'massupdate' => 0,
    'comments' => '',
    'help' => '',
    'importable' => 'true',
    'duplicate_merge' => 'disabled',
    'duplicate_merge_dom_value' => '0',
    'audited' => false,
    'reportable' => true,
    'calculated' => false,
    'len' => '255',
    'size' => '20',
    'id_name' => 'taxrate_id_c',
    'ext2' => 'TaxRates',
    'module' => 'TaxRates',
    'rname' => 'name',
    'quicksearch' => 'enabled',
    'studio' => 'visible',
);

$dictionary["Account"]["fields"]["taxrate_id_c"] = array (
    'required' => false,
    'name' => 'taxrate_id_c',
    'vname' => '',
    'type' => 'id',
    'massupdate' => 0,
    'comments' => '',
    'help' => '',
    'importable' => 'true',
    'duplicate_merge' => 'disabled',
    'duplicate_merge_dom_value' => 0,
    'audited' => false,
    'reportable' => true,
    'calculated' => false,
    'len' => 36,
    'size' => '20',

);

 $dictionary["Account"]["fields"]["currency_c"] = array (
    'required' => false,
    'source' => 'non-db',
    'name' => 'currency_c',
    'vname' => 'Currency',
    'type' => 'relate',
    'massupdate' => 0,
    'comments' => '',
    'help' => '',
    'importable' => 'true',
    'duplicate_merge' => 'disabled',
    'duplicate_merge_dom_value' => '0',
    'audited' => false,
    'reportable' => true,
    'calculated' => false,
    'len' => '255',
    'size' => '20',
    'id_name' => 'currency_id_c',
    'ext2' => 'Currencies',
    'module' => 'Currencies',
    'rname' => 'name',
    'quicksearch' => 'enabled',
    'studio' => 'visible',
);

$dictionary["Account"]["fields"]["currency_id_c"] = array (
    'required' => false,
    'name' => 'currency_id_c',
    'vname' => '',
    'type' => 'id',
    'massupdate' => 0,
    'comments' => '',
    'help' => '',
    'importable' => 'true',
    'duplicate_merge' => 'disabled',
    'duplicate_merge_dom_value' => 0,
    'audited' => false,
    'reportable' => true,
    'calculated' => false,
    'len' => 36,
    'size' => '20',

);


I'm not sure why there would be a difference between the two custom fields, they are essentially setup the same. 

Any suggestions or recommendation would be great. Thanks. 

FYI, running Sugar 12.0.0 Ent POn-Prem. 

Parents Reply Children
  • Hi Jeff, thanks for the reply. However my goal is to have a Currency filed, much like the currency field on the Quote (See Below)

    Just a simple selection of the currency type on an account, this will then be used as the default currency when a quoute is created associated to that account. 


    When I add a custom Currency field via studio, I get more the amount style field you would find on a QLI. (See Below)

    I have had a look in the vardefs.php of Quotes, however I cant seem to find how the Currency field is added on its own without the amount/value field. 


    If you have any ideas or pointers it would be appreciated.