Record Layout (LWC)
The GM - Record Layout (LWC) component is designed to display related standard or custom Salesforce objects using a configurable layout. It overcomes the limitations of the Salesforce UI API, offering a more flexible and powerful way to interact with data.
This component enables the manipulation of any Salesforce object standard or custom with dedicated support for Event and Task records.
Global Key Features
Multi-Column Layout: Supports layouts with more than two columns for greater flexibility and improved visual organization.
Dynamic Forms: Dynamically display fields based on the values of other fields, enabling intelligent and responsive form behavior.
Advanced Error Handling: Implements Salesforce-like record and field-level error handling to ensure a consistent user experience.
Conditional Coloring: Supports custom coloring rules to enhance readability and highlight key data.
Edit Features
Edit and Form Modes: Easily switch between read-only and editable modes to accommodate different interaction needs.
Delegated Save: Provides delegated save functionality for streamlined data handling and custom logic control.
Default Values: Allows setting default field values for faster and more accurate record creation.
Enhanced Record Layout
Multi-Column Layout
GridMate bypasses Salesforce’s standard 2 columns layout limitation, allowing for more flexible and customizable record layouts.

Below the the Multi-Column Layout Json configuration.
Dynamic Forms
Dynamically display fields or sections based on the values of other fields.

Below is the JSON configuration used for this example:
{
"apiName": "Website",
"visibility": {
"Industry": {
"operator": "=",
"value": "Media"
}
}
}{
"name": "addressInformation",
"label": "Address Information",
"active": true,
"cols": 2,
"visibility": {
"Industry": {
"operator": "!=",
"value": "Media"
}
},
"rows": [...]
}Advanced Error Handling
We can handle both field-level and record-level errors. In this example, we’ve created two validation rules:
The first rule triggers an error message at the field level.
The second rule displays the error at the record layout level.

Below is an example of how it will be displayed on the UI:
The first validation rule shows an error message directly on the field where the issue occurs.
The second validation rule displays the error at the record layout level, indicating a broader record-related issue.

Conditional Coloring
Below is an example of Conditional Coloring: When the Account Source is set to Partner, the Account Site field is automatically highlighted in green to visually indicate the condition, and this behavior works in both Edit and Read modes.

Below is the JSON configuration used for this example:
{
"apiName": "Site",
"coloring": [
{
"color": "#a6f79e",
"exp": {
"AccountSource": {
"operator": "=",
"value": "Partner"
}
}
}
]
}Edit/Form Mode
To enable Edit Form Mode, the component must be wrapped inside an Aura wrapper. Below is the configuration used for this setup.
Component Managed Save
Allow the component to handle the save process and error handling automatically.
You can also redirect or customize any post-save actions inside the handleSave method
Delegated Save
If you prefer complete control over the save logic, enable delegatedSave.
In this mode, the new record or changes are exposed in the handleSubmit method, and the database save operation must be explicitly handled by the developer.
No action bar
It allows you to add a footer section with Save and other custom buttons that aren’t part of the default layout action bar.
The Save button calls recordLayout.saveRecord() to save the current record.
// if you want to remove box-shadow and padding
.THIS .risen {
box-shadow: none;
padding: 0;
}Record Layout Description
1. Overall Structure
The JSON defines a record layout configuration for a UI component.
At the top level:
density → controls field spacing ("comfy", "compact").
sections → an array of section objects, each defining its own layout and behavior.
2. Section object properties
Each section in "sections": [ … ] has these key properties:
name
Internal unique identifier for the section (used in logic).
{
"name": "accountInformation"
}label
The display title of the section, shown to users.
{
"label": "Account Information"
}active
A flag (true/false or special value like "always") that controls if the section is enabled. If set to "always" it means the section is always active.
cols
Number of columns to display in that section. This controls layout/grid: how many fields (or blocks) appear per row.
visibility
A visibility condition (JSON object) that determines whether the entire section is visible or hidden based on field values of the record. This follows the same rule‐structure as the “readOnly” conditions (operator, value).
readOnly
A read‐only condition for the whole section. If this evaluates true, all fields in the section become non‐editable.
rows
An array of rows. Each row is itself an array of “cells” (either field definitions or emptyBlock definitions) that fill up to cols columns. Fields can span columns using colSize.
3. Field (cell) object properties
Inside rows, each cell can be:
A field object with properties, or
An empty block object: { "emptyBlock": true } (used for layout alignment).
For field objects, common properties include:
apiName
The API name of the field in the data model that will be displayed.
{
"apiName": "Name"
}colSize
Optional. Defines how many columns wide the field spans (useful when a field should cover more than a single column).
{
"apiName": "Description",
"colSize": 2
}noWhitespace
Optional boolean. If true, removes extra whitespace/margins around the field component.
{
"apiName": "Industry",
"noWhitespace": true
}readOnly
A JSON condition (like visibility) that determines if the field is editable or not. Even if the section is editable, this field can individually be read‐only.
{
"apiName": "AccountSource",
"readOnly": {
"AccountSource": { "operator": "in", "value": ["Web", "Other"] }
}
}visibility
A JSON condition that determines whether the field is shown at all.
{
"apiName": "Industry",
"visibility": {
"BillingCountry": { "operator": "!=", "value": "USA" }
}
}coloring
An array of coloring rules: each rule has a color value and an exp object that defines a condition under which that color is applied to the field. This allows conditional highlighting.
{
"apiName": "Status",
"coloring": [
{
"color": "#a6f79e",
"exp": { "Status": { "operator": "=", "value": "Active" } }
}
]
}emptyBlock
If the object is { "emptyBlock": true }, it means “insert an empty slot here” for layout purposes (no field displayed).
[
{ "apiName": "Description", "colSize": 2 },
{ "emptyBlock": true }
]autocomplete
Provides a City field with an autocomplete dropdown, suggesting values like Paris, London, New York, and Rome as the user types.
{
"apiName": "City",
"autocomplete": ["Paris", "London", "New York", "Rome"]
}Examples
Last updated
Was this helpful?