Drop down list with hyphen in the value

I have a situation where I want to use a hypen in a value in a dropdown list.  I have an on-site installation and I'm using this field value in the Sugar database to join to an external database table.  So, I need the dropdown item name to include the hypen, not just the label.  The hypen character is not allowed in the database item name in the dropdown editor.

To be specific, I've got a guy named Alan-Dee.   In the display label part of the dropdown, Alan-Dee is fine, but you can't use Alan-Dee in the dropdown item name because the hyphen is not allowed.  So, we have to enter it as AlanDee or Alan_Dee.   Unfortunately, we use this column in the sugar table to join to an external database user table - where his name is Alan-Dee - so, the join doesn't work.  

My option is to either change every report and process that joins to this field to handle the name mismatch, or try to fix the data in Sugar.  My preference would be to fix it in sugar if possible since it would otherwise have to be changed in 20+ places.

I can come up with various ways to update the value in the sugar accounts_cstm table to be what I want, but once it no longer matches the dropdown value, it won't show in the Sugar UI.   Is there a way to bypass the dropdown editor and directly update the value in the file system to be what I need?  ("Alan-Dee" instead of "Alan_Dee")   I would be gambling that there is no real reason why a hyphen can't be used in a dropdown value.   I have a sandbox system where I could test this.

I don't know where or how dropdown lists are actually stored.  Can anyone tell me either that this is worth trying, or that it's a harebrained idea that should forgotten altogether?

Parents
  • Hi  

    Dropdown lists are stored in custom/Extension/application/Ext/Language/.

    Files are in the form: <language prefix>.sugar_<dropdown name>.php

    We set up our dropdowns to match our ERP system back in 2010 when we first started using Sugar and many special characters were still allowed at that time.

    We have not changed those values upgrade after upgrade and are now on v25.1 Enterprise.

    Make changes at your own risk, but I can tell you my system still works Shrug

    FrancescaS

  • Appreciate the reply.  FWIW..  I found the dropdown stored here  /sugarrootfolder/custom/Extension/application/Ext/Language/en_us.sugar_dropdownlistname.php  and simply made the change to insert the hyphen.  Did a quick repair and all seems to be working fine.  I can still edit the dropdown list with the dropdown editor, and the dropdown seems to work as expected everywhere it's used.  I did have to update the database to replace the old values with the new (in my case, the accounts_cstm table).   As much as I dislike kludgy solutions like this, it's certainly easier than my alternatives.  BTW.. this is version 14.0.3.

Reply
  • Appreciate the reply.  FWIW..  I found the dropdown stored here  /sugarrootfolder/custom/Extension/application/Ext/Language/en_us.sugar_dropdownlistname.php  and simply made the change to insert the hyphen.  Did a quick repair and all seems to be working fine.  I can still edit the dropdown list with the dropdown editor, and the dropdown seems to work as expected everywhere it's used.  I did have to update the database to replace the old values with the new (in my case, the accounts_cstm table).   As much as I dislike kludgy solutions like this, it's certainly easier than my alternatives.  BTW.. this is version 14.0.3.

Children