Conditional Page View Layout - Show/hide fields depending on primary field

Hey guys,

I am reaching for a feature I had in Salesforce and its bugging me, I hope to reach for the wisdom of the team for insight on the best method forward.

In SF I had page views, which meant we could be different layouts dependent on a specific field on the record “record type”

This mean that we could change the layout for instance based on various options with the record to make the screen more relevant to the context of the record.

Different layouts Examples

  • Contract types or different stages of the contract process
  • Contact types, ie an retail individual vs a company B2B contact
  • Product types, show only relevant fields depending on the product type, this was useful for grouping products so we had parent products and child products.

The benefits for this was huge again beyond just simplifying the interface but for the broader database as it meant faster indexing, was easier to build and maintain reports along with 3rd party integrations with simplifying logic.

Ultimately, the user case is to keep the sales team happy so we keep up utilization, making sure it is as simple and uncluttered as possible.

Collated some further thoughts and keen to explore the logic and code behind it if anyone has it laying around or can suggest a method to programatically build it so we can reuse it easily from admin over multiple objects.

Really there are 2 quick methods of approaching it, conditional logic on the field in a similar way to how there are plugins to handle based on user security settings/roles

Or setting up a panel that is conditional based on fields within the record, but this would limit us to being able to use the field once in the record, so not flexible to handle multiple instances of the same field

Plugin Dynamic Panels

I think ultimately a mix of these 2 functions would be ideal, as we have conditional fields we want to show in the event of a status update such as cancellation to explain further details about the cancellation. Then like we have above, in the various layouts depending on the record type for the context of the record.

This is what I was referring to from SF

Had a play with the dynamic panels, its on the right path but its all front end.
So it retrospectively hiding the content after the page has loaded via javascript, so it loads and flashes the fields and content infront of you and then hides it. From a security perspective, it will simply be circumvented by someone looking at the page source.

New strategy is to figure out these 2 tasks in the backend

  1. ability to add the same field multiple times to a detail layout in studio
  2. ability to hide/show a panel via configurable logic ie user = role, and/or field = x , (controllers ie =, !=, >, <, =>, =< etc) . This logic would be then ran from the backend PHP rather then frontend javascript.

By doing so, we can setup panels to act like page layouts similar to what we have in Salesforce

Question: has anyone had any experience with the 2 items above? looking for shortcuts

I’m following this solo thread with interest, but unfortunately I don’t have much to add, I’m hoping someone else will be able to help you a bit :slight_smile: