Why use Form Layout over Section Layout

Certified Senior Developer

I'm trying to figure out the differences between Form Layout and Section Layout. Mainly, is there any reason to use a Form Layout over a Section Layout? I've been using Section Layout because I seem to be able to do everything I need with it. I understand the notion of "well, if it works for what you need, then use it". I also understand that we have the ability to nest Section Layouts (which is one main reason why I use them), but not Form Layout. However, I still continue to wonder what the actual purpose of Form Layout is for. If there is a downside to using Section Layout in lieu of Form Layout.

  Discussion posts and replies are publicly visible

  • +1
    Certified Lead Developer

    Nominally, Form Layout is intended specifically to be a top-level container for Task Forms.  It contains a header label that's different from the section layout header, and its own buttons section which will always be bottom-oriented, and has its own form-level validations spot (though that's easy to replicate in an individual section as well).  The FormLayout may contain any number of nested sections (and/or other elements). 

    Really these days it's optional, though I always use it for tasks to maintain a consistent Button style at the very least, as well as to get the top-level form header.

  • Generally agree with Mike - in most cases they are the same. The two things that Form Layouts do that I'm pretty sure other components don't do are:

    • Allow you to specify if the form should focus on the first field or not
    • Allow you to have native button layout configurations for mobile

    I can't think of anything else that couldn't be replicated in some other way using a section layout (or other components).