One of the big challenges for us when building the packaged applications is that we’re effectively developing blind–we don’t have a direct customer who is providing us with specific project requirements, so we do our best to come up with the fields that users are likely to want. Naturally, this is…difficult.
One of our main solutions to this problem is the introduction of “flex fields”–extra columns that application administrators can use for data that we didn’t think to build in. Our first implementation was released in the Customer Tracker application in 4.2.4, but we decided that it wasn’t as user-friendly as we’d like, so in the 4.2.5 release, we included flex fields with a much better interface in Customer Tracker and P-Track. We’ll be adding them to more applications as we go forward.
The design is fairly straightforward: any table which supports flex fields has 17 additional columns–8 varchar2(4000), 4 number, 4 date/timestamp, and one CLOB. There’s also a flex registry table that tracks which column(s) have been enabled, what the label should be, if it has a format mask, and so on. We tried to include a lot of options, so you can customize it pretty thoroughly. All of the relevant report pages have columns for the flex fields which display only if the field is active, and all of the relevant form pages include fields for the flex columns (which are, again, conditional).
This last bit is really where the biggest chunk of “magic” comes into play. Because we allow for a variety of different item types (text field or area, select list, date picker, number field), the built-in APEX page items weren’t sufficient. Instead, we built a new item plugin that looks at the registry table to figure out how to correctly render the page item.
If you’re using the Customer Tracker or P-Track packaged apps already, try out the flex fields. If you’re developing your own applications for customers who periodically request that columns be added or removed (wait, project specs never change capriciously, right?), take a look at our implementation and see if you can incorporate it–might just save yourself some hassle!