I tried to use lightning:recordEditForm to create a new custom setting record but I received an error saying

Error in fetching record or record metadata. [Unexpected Error when retrieving 'Custom_Setting__c' Layout Information ]

enter image description here

I can't find any information in the official documentation that custom settings are not supported for lightning:recordEditForm, is this just not documented or is there a way to get it working?

Update: This is the code I use

Application example code

<aura:application >

Lightning component example code

<aura:component >
    <lightning:recordEditForm objectApiName="Custom_Setting__c">
        <div class="slds-box slds-theme_default">
            <lightning:inputField fieldName="Date_Before__c"/>
            <lightning:inputField fieldName="Date_After__c"/>
            <lightning:inputField fieldName="Site__c"/>
            <lightning:inputField fieldName="Project__c"/>

Also, Custom_Setting__c is hierarchy custom setting with at least four fields . Date_Before__c, Date_After__c, Site__c, Project__c enter image description here

  • Can you post how are you trying to use/create the custom setting in your component?
    – Jayant Das
    Apr 25, 2018 at 13:11
  • yes, sure, I am going to update my question
    – Patlatus
    Apr 26, 2018 at 11:42
  • @JayantDas Edited my question to include the code I use
    – Patlatus
    Apr 26, 2018 at 11:47
  • Custom Settings are not supported with the component. I have provided more details as an answer. Hope that helps.
    – Jayant Das
    Apr 26, 2018 at 12:49

2 Answers 2


Even though not explicitly mentioned on the documentation, Custom Settings do not seem to be supported with lightning:recordEditForm. Going through the documentation, below are some details to support this.

The documentation of lightning:recordEditForm mentions:

lightning:recordEditForm and lightning:inputField support the following features.

  • Display a record edit layout for editing a specified record
  • Display a record create layout for creating a new record

The component depends on the UI-API to fetch any layout details of the object to be able to render as create/edit screen along with combination of input fields. And because Custom Settings do not really have any layout associated with them, that is where you get to see the error when you load the component using custom setting (Unexpected Error when retrieving 'Custom_Setting__c' Layout Information) .

Below is an excerpt from UI-API documentation:

This resource returns all the information necessary to display a record in an app: layout metadata, object metadata, and record data.

For a list of objects supported by UI-API, you can find more details here.

  • It is a pity that 3 years have been passed but Custom Settings are still not supported by the lightning:recordEditForm
    – Patlatus
    Feb 1, 2021 at 12:54

However, this is mentioned in the documentation

Input Field documentation says that

See Supported Objects in lightning-record-edit-form for usage considerations about objects.

while Lightning Record Form says that

For a list of supported objects, see the User Interface API Developer Guide.

and User Interface API Developer Guide says that

User Interface API supports all custom objects and external objects and many standard objects.

which means that custom settings and custom metadata are not supported.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .