How can I make a field conditionally required (without using a validation rule)?

  • 3
  • Idea
  • Updated 1 year ago
  • Under Consideration
I have a couple of fields that should not be required based on data in the rest of the record. I'd rather not mark them as not required and build a validation rule on the back end. We are using these pages in our community and validation rules are often seen as a gotcha by users who can't see that it is required until they go to save. Ideas?
Photo of Thaddeus Ward

Thaddeus Ward

  • 90 Points 75 badge 2x thumb

Posted 5 years ago

  • 3
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
We've been kicking aroudn the idea of packaging conditional properties with the rendering conditions that we are working on.  So for any given component - in addition to building conditions that manage if it should show or hide,  conditions could determine whether the field should be required, set its default value,  etc.  Of course that's all pie in the sky right now,  but its where we are headed. 

For now I think the answer is that you could control the client side validation with custom Javascript using a custom renderer.    I think thats the best you could do...
Photo of Krishnakumar KR

Krishnakumar KR

  • 60 Points
Hello, Was this ever built into the product?
Photo of Chandra V

Chandra V, Champion

  • 6,966 Points 5k badge 2x thumb
We just put the field twice on the layout - once as required, and conditionally show this field when the field is required.  Other time is the not required version.  The situation drives whether the user sees the required or not required field.