Store Drop down Items in Database?

Hello,

When I am creating a new drop down the value/key pairs are stored in an array in a file. Is there a way to change that so the value/key pair is stored in a database table?

Thanks.

All the dropdown values including keys are saved within a file. there are no options to change this in SuiteCRM.

Just out of interest what are you trying to do which requires you to save this information into the database ?

Ian

I am replacing an application that pulls yarn colors from an AS/400 system a couple of times a day. Currently the colors are stuffed into a table with an active or not active flag and those that are active are populated in a drop down.

I was afraid storing these key/value pairs in table wouldn’t be possible. So my thought process now is, to create a job outside of SuiteCRM to populate a table from our AS/400 system and either try and build the drop down array from a custom query inside the custom >> language >> en_us.lang.php file, or, periodically throughout the day, run a batch process outside of SuiteCRM that builds the new array and replaces it inside the file.

Hopefully I can find some time today to test these ideas.

Another Idea would be to create a custom module which contains the colours. where that custom module is related to the module which would have contained the dropdown.

This would give you the ability to have the details saved in the database.

Ian.

1 Like

Thanks for the idea. I will try that route first.

1 Like

Hello,

I know this topic is a little bit old, but there’s a way to achieve what you want. Please have a look at this article:
http://developer.sugarcrm.com/2011/08/24/howto-have-a-dropdown-field-that-gets-its-options-from-a-function/

Hope this helps!

Regards, Celso.

1 Like