How to import dropdown values

I have created a new module with some drop down fields.

Each of those dropdowns will have around 100 values. So I don't want to manually enter the values and also up-coming changes of dropdown values.

Is there a way to simply import the values via studio?

I have found the following links, which are helpful if you have access to file-system. I am currently working on a Sugar On-Demand project, so I got no direct access.

Allow import of a list of data for a drop down list 

How do I import a list of categories to make into different "industry" fields? 

Editing of dropdown values via code 

Parents
  • Hi Günter Swatschina 

    You can manage the dropdown keys and values in a Excel spreadsheet and apply the funcion "concatenate" in order to compile each dropdown entries the way SugarCRM can read, just like that:

    'key_1' => 'Value 1',

    'key_2' => 'Value 2',

    Then you can build an installer which just override the language file regarding your dropdown lists.

    This is the easiest way to do that as regular dropdowns.

    Kind regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Finally I made it.

    Steps to take:

    1) Get a manifest.php file. Existing one or click “Export customization” in studio and remove not needed files/folders.A manifest.php is included.

    2) Edit language file e.g.: “de_DE.drp_preisliste_list.php” >> add all dropdown values.
    $app_list_strings['drp_preisliste_list'][0] = 'Springer VK-Brutto';
    $app_list_strings['drp_preisliste_list'][1] = 'VK-Brutto A/D/L';
    $app_list_strings['drp_preisliste_list'][22] = 'Basispreisliste NL / B in EURO';

    3) Save it to folder “/custom/Extension/application/Ext/Language”.

    4) Set correct file paths in manifest.php >> $installdefs >> language

    'language' =>

      array (

        0 =>

        array (

          'from' => '<basepath>/custom/Extension/application/Ext/Language/de_DE.drp_preisliste_list.php',

          'to_module' => 'application',

          'language' => 'de_DE',

        ),

      )

    5) Zip the files. Not the root folder!

    6) Upload .zip file with Module Loader into SugarCRM On-Demand.

    7) Done

    ------------------------------------------------------------------------------------------

    I have changed the "package" several times and re-uploaded the zip with Module Loader.

    It worked and didn't overwrite content on the target system.

    Hint: Never uninstall a package!

    Please add any comments to this steps if you got additional helpful information.

Reply
  • Finally I made it.

    Steps to take:

    1) Get a manifest.php file. Existing one or click “Export customization” in studio and remove not needed files/folders.A manifest.php is included.

    2) Edit language file e.g.: “de_DE.drp_preisliste_list.php” >> add all dropdown values.
    $app_list_strings['drp_preisliste_list'][0] = 'Springer VK-Brutto';
    $app_list_strings['drp_preisliste_list'][1] = 'VK-Brutto A/D/L';
    $app_list_strings['drp_preisliste_list'][22] = 'Basispreisliste NL / B in EURO';

    3) Save it to folder “/custom/Extension/application/Ext/Language”.

    4) Set correct file paths in manifest.php >> $installdefs >> language

    'language' =>

      array (

        0 =>

        array (

          'from' => '<basepath>/custom/Extension/application/Ext/Language/de_DE.drp_preisliste_list.php',

          'to_module' => 'application',

          'language' => 'de_DE',

        ),

      )

    5) Zip the files. Not the root folder!

    6) Upload .zip file with Module Loader into SugarCRM On-Demand.

    7) Done

    ------------------------------------------------------------------------------------------

    I have changed the "package" several times and re-uploaded the zip with Module Loader.

    It worked and didn't overwrite content on the target system.

    Hint: Never uninstall a package!

    Please add any comments to this steps if you got additional helpful information.

Children
  • Hi. Not sure where I'm going wrong, if anyone could help I'd really appreciate it.

    Manifest:

    <?php

    $manifest = array (
    'built_in_version' => '13.0',

    'acceptable_sugar_versions' => array(
    'regex_matches' => array(
    '7\\.9\\..+$',
    '7\\.10\\..+$',
    '7\\.11\\..+$',
    '8\\.[0-9]\\..+$',
    '9\\.[0-9]\\..+$',
    '10\\.[0-9]\\..+$',
    '11\\.[0-9]\\..+$',
    '12\\.[0-9]\\..+$',
    '13\\.[0-9]\\..+$',
    ),
    ),

    'acceptable_sugar_flavors' => array (
    0 => 'ENT',
    1 => 'ULT',
    2 => 'PRO',
    ),

    'readme' => '',
    'key' => '',
    'author' => 'jk',
    'description' => 'test dropdown import',
    'icon' => '',
    'is_uninstallable' => true,
    'name' => 'test_dropdown_import',
    'published_date' => '2023-08-16 16:00:01',
    'type' => 'module',
    'version' => 1.9,
    'remove_tables' => 'prompt',
    );

    $installdefs = array (
    'id' => 'test_dropdown_import',
    'language' =>
    array (
    0 =>
    array (
    'from' => '<basepath>/custom/Extension/application/Ext/Language/en_UK.testEP_templates_detail_list.php',
    'to_module' => 'application',
    'language' => 'en_UK',
    ),
    ),
    );


    en_UK.testEP_templates_detail_list.php contains

    <?php

    $app_list_strings['testEP_templates_detail_list']'P00'=>'Link records';
    $app_list_strings['testEP_templates_detail_list']'P01'=>'Verbal advice given';
    $app_list_strings['testEP_templates_detail_list']'P02'=>'Memo';
    $app_list_strings['testEP_templates_detail_list']'P04'=>'Abatement Notice S80';
    $app_list_strings['testEP_templates_detail_list']'P05'=>'Enforcement Notice Section 34';
    $app_list_strings['testEP_templates_detail_list']'P06'=>'Notice Letter';