change textfield to dropdown On-Demand instance

Hi Guys,

I would like to change the Billing Country field from 'Textfield' to 'Dropdown' on an on-demand instance.

I have found some answers but are only applicable to an on-site instance.

How can I do this?

So far I have tried different php files using the Module Loader but is not working.

please find my script below:

<?php

    $manifest =array(
        'acceptable_sugar_flavors' => array('CE','PRO','CORP','ENT','ULT'),
        'acceptable_sugar_versions' => array(
            'exact_matches' => array(),
            'regex_matches' => array(
                0 => '6\\.5\\.(.*?)',
                1 => '6\\.7\\.(.*?)',
                2 => '7\\.2\\.(.*?)', 
                3 => '7\\.2\\.(.*?)\\.(.*?)', 
                4 => '7\\.5\\.(.*?)\\.(.*?)', 
                5 => '7\\.6\\.(.*?)\\.(.*?)'
            ),
        ),
'name' => 'Textfield to Dropdown',
  'description' => 'Converting Billing Country textfield to Dropdown Field',
  'author' => 'myname',
        'icon' => '',
        'is_uninstallable' => true,
         'published_date' => '2015-01-09 19:00:00',
        'type' => 'module',
        'version' => '1.0',
    );
    
 $dictionary['Account']['fields']['billing_address_country']['type']='enum';
 $dictionary['Account']['fields']['billing_address_country']['ext1']='countries_dom';
?>

The module loads fine but there is no change after I quick repair.

what am i doing wrong?

Please advise.

Cheers

H

  • Hi everyone,

    I got this question answered on another forum.

    I am posting the answer here for future reference.

    Thanks to Karl Hill for his help

    Answer below:

    You need to create the manifest.php file and have that point to the file(s) you want to copy/upload for customization:

    manifest.php:

    <?php
    
    $manifest = array(
      'built_in_version' => '7.6.1.0',
      'acceptable_sugar_versions' =>
      array(
      0 => '',
      ),
      'acceptable_sugar_flavors' =>
      array(
      0 => 'PRO',
      1 => 'CORP',
      2 => 'ENT',
      3 => 'ULT',
      ),
      'readme' => '',
      'key' => 'SO',
      'author' => 'Eric',
      'description' => 'Convert Accounts Billing Country TextField to Enum',
      'icon' => '',
      'is_uninstallable' => true,
      'name' => 'TextFieldToDropdownPkg',
      'published_date' => '2016-01-10 03:01:01',
      'type' => 'module',
      'version' => 1452378413,
      'remove_tables' => 'prompt',
    );
    
    $installdefs = array(
      'id' => 'TextFieldToDropdownPkg',
      'copy' => array(
      0 => array(
      'from' => '<basepath>/custom/Extension/modules/Accounts/Ext/Vardefs/custom_billing_address_country.php',
      'to' => 'custom/Extension/modules/Accounts/Ext/Vardefs/custom_billing_address_country.php',
      ),
      ),
    );
    

    Then create:

    custom/Extension/modules/Accounts/Ext/Vardefs/custom_billing_address_country.php

    <?php
    
    $dictionary['Account']['fields']['billing_address_country']['comments']='Country for primary address';
    $dictionary['Account']['fields']['billing_address_country']['group']='primary_address';
    $dictionary['Account']['fields']['billing_address_country']['options']='countries_dom';
    $dictionary['Account']['fields']['billing_address_country']['type']='enum';

    Zip up, load the module and done.

    Cheers

    H