> For the complete documentation index, see [llms.txt](https://docs.gridmate.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gridmate.io/package-reference/components-library/records/gm-record-layout-lwc.md).

# GM - Record Layout (LWC)

(gmpkg:RecordLayoutLWCComponent)

## **Documentation**

**GM - Record Layout (LWC)** component is used to display a related object using a layout configuration same as [GM - Record Layout](https://docs.gridmate.io/package-reference/components-library/records/gm-record-layout.md#documentation). It bypasses the limitation of Salesforce UI API. This component can be used to manipulate any Salesforce object especially **Event** and **Task**.

**Use case:** Display the event details when expanding a record from open activities related list. See [Record Layout (LWC) tutorial](https://docs.gridmate.io/product-tour/records/record-layout-lwc.md).

## **Specification**

<table data-full-width="true"><thead><tr><th width="191.67917410949835">Property</th><th width="154.55150547835012">Type</th><th width="491.1782559590265">Description</th></tr></thead><tbody><tr><td>recordId</td><td>String</td><td>recordId to use. Use it only for community.</td></tr><tr><td>Object Name *</td><td>String</td><td>The name of the related object to display.</td></tr><tr><td>Record Id Field *</td><td>String</td><td>The name of the lookup field to display. If the record layout displays the current object, set this field to <strong>recordId</strong>.</td></tr><tr><td>Record Layout *</td><td>String</td><td>JSON record layout describing the sections and their visibility. See <a href="https://docs.gridmate.io/package-reference/components-library/records/gm-record-layout.md#record-layout-schema">Record Layout Schema</a></td></tr><tr><td>Show Border</td><td>Boolean</td><td>Check this option if you wish to show the record card border.</td></tr></tbody></table>

Compared to [**GM - Record Layout**](https://docs.gridmate.io/package-reference/components-library/records/gm-record-layout.md#specification), it provides more capabilities in terms of styling. Section header can be hidden and each field can be styled by setting the variant, the border, the label styling and the value styling. The styling capabilities are useful on a community website for instance. Below is a configuration to showcase the styling:

```json
{
    "density": "comfy",
    "sections": [
        {
            "name": "contactInformation",
            "label": "Contact Information",
            "variant": "header-hidden",
            "active": "always",
            "cols": 1,
            "rows": [
                [
                    {
                        "apiName": "Name",
                        "variant": "label-hidden",
                        "style": {
                            "label": "font-size:large;color:red",
                            "value": "font-size:large;text-align:center;color:green",
                            "border": "none"
                        }
                    }
                ],
                [
                    {
                        "apiName": "gmpkg__Image_Test__c",
                        "variant": "label-hidden",
                        "style": {
                            "value": "text-align:center",
                            "border": "none"
                        }
                    }
                ]
            ]
        }
    ]
}
```

## **API Reference**

{% tabs fullWidth="true" %}
{% tab title="RecordLayoutLWCComponent.design" %}

```xml
<design:component label="GM - Record Layout (LWC)">    
    <design:attribute name="recordId" label="recordId" 
                      description="recordId to use. Use it only for community"/>        
    <design:attribute name="targetObjName" label="Object Name" 
                      description="Object Name to load"/>    
    <design:attribute name="recordIdField" label="Record Id Field" 
                      description="Record Id Field to load" />
    <design:attribute name="recordLayout" label="Record Layout" 
                      description="JSON Record Layout"/>    
    <design:attribute name="showBorder" label="Show Border" 
                      description="Show record card border"/>    
</design:component>
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.gridmate.io/package-reference/components-library/records/gm-record-layout-lwc.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
