On Mon, Jul 27, 2009 at 8:51 PM, John<[email protected]> wrote: > On Monday 27 July 2009 11:30:36 am Miguel Lopes wrote: >> The general solution is setting a default value in the bizobj (that is >> of course in the Keys list of the dropdownList). > > I believe that will not work (unless the default value is set to zero (0)).
Yes it works, I tested it. And the default is not 0 (zero); actually it's 25. > I think you are not understanding what is the root cause of the error. > > In the DB you have a field that is associated with the dropdown. There is a > record with the field that contains a value that is not in the 'Choices' > or 'Keys' of the dropdown (depends on ValueMode). The value in the field > could be a Null. In fact I think you have suggested that the value is a > null. Not exactly. All column values for existing records are within the 'Keys' list of the dropdown. Only when a new record is created (which in the DB defaults to Null), the bizobj converts it to 0 (zero). Hence, when the dropdown fetches the value from the bizobj, we have an exception, which is pretty much what I figured as well. So for praticallity, when there is a restriction on the value (like the case of a 'Choices' or 'Keys'), and if the default value assigned by Dabo's bizobj is different, one *must* assign a default value on the bizobj. > In Dabo Nulls are converted to '<None>' (in most cases) for strings and zero > for numbers (not sure if numbers are converted - Hmmm). So if your keys for > the dropdown contain numbers (1,2,3,4) and the field contains a null (or 0) > you will get the traceback. Yes integer columns get a zero by default (as per previous msg). > So adding the values '<None>', and zero to the Choices, Keys causes the error > to go away. Unless assigning '<None>' / zero are options you want to give to the user, it's better to add a default value to the field in the bizobj. Miguel _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[email protected]
