There is a managed app on the Appexchange and it solves a limitation by employing a "Track History" concept to give admins a boolean setting specific to each datafield on User object (for the purpose of tracking its field history). settings page, This allows admin(s) to define/manage a common set of preferences for Tracking History on User fields.

How would we modify the concept of "Track History" from the image above to build a visualpage that allows the user to manage TRUE or FALSE settings specific to each field in a dynamic fields describe call for a given custom object?

The page must "remember" (persist between page loads) the user's boolean selections for all fields in a custom object.

Unlike the "Track History" example, i dont need to track any field history. I just need to build a visualforce page that reads/writes boolean inputs (“settings”) to a user-specific cache or object where each input is specific to a dynamic list of fieldnames. I believe hierarchical custom settings are the way forward here. Another reason I'm choosing hierarchical custom settings in this design is because it is possible for users to read/write their own custom settings via visualforce

My guess is that the page needs to dynamically describe field names, then query the user's existing hierarchical settings (where they may have indicated boolean preferences for fields), then construct the input booleans on the page according to their settings or defaulting to some default in the case of no found settings record for the given field.

Has anyone tried this with any success?

Thank you community!

  • 2
    What's the use case for this specifically, though? What are the settings meant to do? Do they later affect logic in a trigger, a Visualforce page, Lightning, elsewhere? – sfdcfox Apr 16 '18 at 4:41
  • hey @sfdcfox! The use-case: I have a visualforce page that loads a jquery library that displays a grid/table whereby the columns in a table need to be dynamically defined by the user. My thought is to give the user a settings page (visualforce page) and have them manage checkboxes next to fieldnames to decide which fieldnames will appear as a column headers in the jquery table/grid. – Peter Noges Apr 16 '18 at 5:13
  • Hierarchy Custom Settings may work, but you'll need a number of text fields to store the field names. Hierarchy Settings are not well-suited for storing multiple rows of data like what the field tracking app provides. You'll want to consider this as a potential problem. I would probably try it out though, to see if it works. Other solutions might include a custom object record, or maybe even localStorage. – sfdcfox Apr 16 '18 at 6:37
  • I'd consider using a custom object record rather than custom settings and storing the expressed preferences in a long text field as a JSON-serialized Map. – David Reed Apr 16 '18 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.