Group: Awaiting Activation
Posts: 592,
Visits: 3.7K
|
I have an application that requires user defined fields. In the original version I used the method suggested by Keith of stacking them vertically one field per row and pivoting later. This seemed to be the best solution as it had the advantage of not requiring a database change to increase the number of user defined fields. What I found was there was a lot of work in managing these fields both at the business object level and the UI.
In the end I found that in practical use the number of user defined fields never exceeded 10 so in version 2.0 I switched to just allocating 10 user defined fields in my main table along with adding 10 fields to the UI where I can hide the unused fields through a combination of visibility and form resizing. All of the fields are stored as string and I control what the user can enter into the field by creating a field definition record for each user defined field that holds an input mask, RegEx string, base data type, and other information to allow enforcement of business rules and conversion to other data types
As Keith said it really depends on what your needs are. The ‘stacking’ solution is more elegant and allows greater flexibility but the pre-allocated method is far easier to implement.
-Larry
|