Limit integer field length or replace with numeric(n,0)?

  • 7 January 2021
  • 2 replies
  • 63 views

Userlevel 5
Badge +15

 

I’ve got some fields indicating an integer “Quantity”, and they have a min/max value to prevent excessive user input. For example a purchase order line quantity or a stock / inventory quantity.

The problem is the following (animated gif):

There is not really a restriction on the integer field, in contradiction to the numeric field. If you press and hold “9” for a while it will fill up and when tabbing to the next field it's cleared (unless it's lower than int.maxvalue).

If you do the same in a numeric(4,0) field it stops after 4 times 9. In a user point of view this is more friendly: The user knows exactly what the limit is, therefore developing a default / layout concept is not necessary.

If you do develop a default for the integer field, it won't be executed when the value is passed int.maxvalue. That is unclear for our users if you want to warn them about the excessive number.

Thing is we don't want to bother our end users with a ‘random’ clear of a field value. We could solve this by replacing the integer fields with numeric(n,0), but in my opinion int should not be replaced by numeric(n,0) if there are min/max bounds present.

You might think: Your users are doing weird stuff: Yes they do and will try and report bugs back on this. It should be fool proof. As ISV we can't tell them they are doing weird stuff. The software should solve that.

Any thoughts about …

  • Is it reasonable that int is replace by numeric(n,0)? Our quantity limit is currently 999.999, so a numeric(6,0) should fit perfectly without additional defaults/layouts/conditional layouts.
  • Should fields be out of te box properly restricted according to it's min/max value specified in the domain? (Is this a good Idea or just simply wrong in the first place?)
  • Or is there another way to solve this?

This topic has been closed for comments

2 replies

Userlevel 6
Badge +16

The GUI should respect the restrictions set in the min/max value, I will create a bug for this. As a workaround you can set the field to numeric like you suggested. 

Userlevel 5
Badge +15

The GUI should respect the restrictions set in the min/max value, I will create a bug for this. As a workaround you can set the field to numeric like you suggested. 

Hi Erwin,

Thanks for the update. Please keep us updated about the development of this. The workaround is possible, but is causing a migration script of large tables I'd rather prevent.