function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
dhanakoti sdhanakoti s 

How to insert a record in Custom object through aura component page

Please suggest me the code to insert a record through aura component page and displaying the same object records in aura page
AbhinavAbhinav (Salesforce Developers) 
To create a record using lightning:recordForm, leave out the recordId attribute.
 
<aura:component>
    <aura:attribute name="fields"
                    type="String[]"
                    default="['Name', 'Industry']"/>
    <lightning:recordForm objectApiName="Account"
                          fields="{!v.fields}"/>
</aura:component>

Check below blog which has multiple scenario with code snippet.

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/data_service_create_record.htm

If it helps mark it as best answer.

Thanks!
Giancarlo BaileyGiancarlo Bailey
Thanks. News to me and this is helpful.
ravi soniravi soni
hi Giancarlo,
if you liked @Abhinav  solution, please mark it as best mark.
Thank you