Multi-Instance Layouts

Updated on

The Multi-Instance Form Layout is a powerful Form Part that allows you to embed a dynamic grid into your form which allows your users to see and update multiple records in one step. Typical use cases include:
 
  • Employment History
  • Continuing Education Credits
  • Annual Reviews

There are two steps:
1. Create a Multi-instance (MI) Layout - Each MI Layout has its own unique parameters and display options. Multi-instance Layouts can be reused on multiple Sonic Forms.
2. Design your MI Layout with suitable options.
3. Deploy the MI Layout onto your form as a Form Part.

Creating a New MI Layout

In order to create a new MI Layout select the "New Layout" option under the Multi-instance Form Part menu.


The New Layout dialog gives you a number of options for creating your MI Layout:


 
  • Layout - Name of your layout.
  • Table name - List of available Multi-instance tables that you can use with this Form Part.
  • Instructions - Short text block that will be displayed to the user to provide guidance on completing the requirements for this MI Layout.
  • Grid Width - Width (in pixels) of the grid on your Sonic Form Page.
  • Popup Width - Width (in pixels) of the popup window that will appear when the "Edit" link is activated.
  • Popup Height - Height (in pixels) of the popup window that will appear when the "Edit" link is activated.
  • New Record Link - The name of the link that will appear in your grid to insert a new record (e.g. "Add another CEU credit.")
  • Stored Procedure - Name of the Stored Procedure that should be called when the save button is activated. This stored procedure is tied to the MI Layout and is in addition to the overall stored procedure associated with the form itself.
  • Allow
    • New Records - Include an "Add" link to insert new records.
    • Editing - Include an edit link to permit individual records to be updated.
    • Deleting - Include a Delete link to permit individual records to be deleted.
  • SQL Filter - A specific SQL query that will be used to determine which records are available for display and/or editing (e.g. STATUS='A').
  • Buttons
    • Save - It will save your layout.
    • Delete Layout - Your MI Layout will be deleted.

MI Layout Design

When designing an MI layout you have two options:

Grid Options

The Grid Options control which field headings are displayed in a the MI Layout. You can control:
  1. Presentation Order
  2. Grid Label
  3. Show or Hide the field

Field Options

Field level options control how the record appears on the Edit or View pop-up.
  1. Field label (can be more expressive than the Grid label)
  2. Required / Not Required
  3. Editable or not
  4. Viewable or not
  5. Validation Table - if applicable
These attributes can be used in combination to create the user experience desired.

Deploying an MI Layout

Deploying an MI layout is easy, simply select the MI layout you wish and click on "Add" to add it to the form in the location indicated.

Pro Tip: Once defined you can use MI Layouts in any Sonic Form. You can also have variants like an Editable version or a read-only version as required.