Default mode for conditionally rendered field

  • 4
  • Idea
  • Updated 2 years ago
I often will have a field that is conditionally rendered due to another field being edited while the component is in inline edit mode.

Think Opp Stage field being set to "Closed Lost" and another field called Reason for Lost Opp being conditionally rendered in edit mode.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb

Posted 2 years ago

  • 4
Photo of Michael Primessnig

Michael Primessnig

  • 252 Points 250 badge 2x thumb
Hi Pat
I suggest to do that with an FieldEditor. Then you can conditionally render the field "Reason for Lost Opp" with:
Source Type: Model field value
Source Model: Opportunities
Field: Stage
Operator: =
Content: Single specified value
Value: Closed Lost

If your FieldEditor is in "Edit" Mode, the "Reason for Lost Opp" Field just will appear, when Stage is Closed Lost and is editable.
(Edited)
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Yes, I don't want the field editor to always be in edit mode.
Photo of Michael Primessnig

Michael Primessnig

  • 252 Points 250 badge 2x thumb
what, when you build your Form by multiple FieldEditors, and render the whole editable Editor with just the given field in it? Ist that a possibility?
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Certainly, I can use multiple field editors, but that require an odd placement for the field. I'd like it to display directly below the Stage field without having to create some silly series of components like a responsive grid or panel set.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
This came up again for my Account Status field. When set to Churn, I would like to Churn_Date__c and Reason_for_Churn__c to be conditionally rendered in edit mode and required. The required part is there but not evident to the user unless they double click edit the fields.
Photo of Henry Goddard

Henry Goddard

  • 776 Points 500 badge 2x thumb
I know internally we've discussed the notion of Field Level Modes, where it would be possible within the same field editor to have any permutation of Edit, Read, Inline modes on different fields. They would usurp the settings defined on the component level.

On that point we also tossed around the idea of Field Level Model Definitions where-by you could be editing many different models in the same field editor.
(Edited)