Skip to Content
0

ComboBox - You Cannot Select an Item - What to Do

Jan 25, 2017 at 06:42 PM

48

avatar image

This is to help other programmers. Today I experienced an issue where I could not select an item in a ComboBox (BoFormItemTypes.it_COMBO_BOX) I added to a custom form in my add-on. I had defined it just like other ComboBoxes on other custom forms, and there was nothing I had forgotten. But still after loading my single "valid value" item into it, I could not select the item. I could open the drop-down and see it on the screen, but after clicking on it the ComboBox and its associated DataSource remained empty. There was no crash or helpful error message of any kind--I just couldn't select the item.

When this happens to you, when you can see the valid value but not select it, the thing to do is double-check the data type of your associated DataSource!

I have always used BoDataType.dt_SHORT_NUMBER for my DataSources, because my ComboBoxes tend to be used to select short things like user IDs, years (e.g. 2017), or an item from a short list.

Today my problem was that the ComboBox was to be used to select an A/R Return document number, and we have enough Returns in our database that a short number will no longer suffice. Once I changed the DataSource to BoDataType.dt_LONG_NUMBER, the ComboBox began working properly again.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers