Consider I have a table called reasons (id, test_id, reason) where test_id is a foreign key with the following sample of values:
1,1,reason1
2,1,reason2
3,1,reason3
4,1,reason4
5,1,reason5
1,2,reason1
2,2,reason2
3,2,reason3
4,2,reason4
if I make a new value list called “reasons” with empty custom values, attached to a check box field, then I have added a function that fires on load of the form with the following code:
var sql_query = “select reason from reasons where test_id = 1”;
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), sql_query, null, 100);
application.setValueListItems( “reasons”, dataset);
I will be getting the following check boxes:
reason1
reason2
reason3
reason4
reason5
If I go back to the value list wizard and check the “Allow Empty Value” then I will be getting the following:
reason2
reason3
reason4
reason5
note that I have missed one, and this happens if the field being attached to is Nullable or Not.
Please advice…