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. 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.

Specification

GM - Record Layout (LWC) component has the same properties as GM - Record Layout. However, 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 and community website for instance. Below is a configuration to showcase the styling:

{
    "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

<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>

Last updated