I've reached a bit of a dead end in my latest programming endeavour. To give a brief overview I'm creating a console that houses data for four custom objects linked together loosely only by their intended purpose whilst still remaining independent.
The console simply outputs a custom list for each objects associated records, which can then be filtered by a number of variables, such as the project that owns the records, whether the records are active or not etc. Inconsequential information.
My problem comes when considering the scenario where a user may want to add a custom field to one of the custom objects (which they should be able to do). I've built the Visualforce to output the wrapper object fields statically and so my build does not allow for the dynamic adoption of any user-changes. Currently the wrapper class processes all possible fields from each object and for each field type does the necessary validation to assess whether the records field is blank or not etc. The Visualforce then assesses whether the wrapper field is null before outputting as standard. The user can select from a multi-select pick list which fields they'd like to see in the columns.
Is there anything I can do or can I take a different approach to allow for dynamic expansion of the wrapper class? I'd love their to be a simple way to perhaps assess the schema of an object and create any wrapper fields necessary based on the schema. Perhaps with pre defined rules for how to assess each field according to its Type.
The four objects share similarities in structure but have enough fields different to justify their independence. Additionally they weren't made under the same object as we liked the idea of having separate related lists on the project page for each one amongst other benefits in having separate objects. However if this is the wrong way to structure my data please let me know.
Any discussion or solution related to my problem is welcomed!