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
Mayuri NehulMayuri Nehul 

lwc-how to create custom object using LWC

Hi Team,
I am new to Salesforce. I have a task to create an app using LWC(Everything needs to create using coding and LWC). I have created fields using LWC but haven't created any object. Can anyone please help with it how to create objects using LWC.
I need to create a controller for the same but I don't have any object reference for it. Your help would be appreciated
Thanks in advance.
SwethaSwetha (Salesforce Developers) 
HI Mayuri,
This post should answer your question
https://salesforce.stackexchange.com/questions/288113/lwc-is-there-a-way-to-instantiate-a-standard-or-custom-object

Related: https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.data_salesforce_write

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Mayuri NehulMayuri Nehul
Hi Swetha,

Thanks for your reply.
I have referred to your reference document but there they have referred object which is already created in UI.
I want to create object by using Apex/LWC without using any manual activity.
Can you please help me how can I achieve this using Apex/LWC. It will be helpful if you can share any sample code for the same.
SwethaSwetha (Salesforce Developers) 
HI Mayuri,
You can create a custom object using Metadata API
Can you try the steps mentioned in the comments of 
https://developer.salesforce.com/forums/?id=906F000000094PYIAY

https://salesforce.stackexchange.com/questions/212714/how-do-i-create-custom-objects-fields-using-salesforce-dx

https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customobject.htm

Thanks
Mayuri NehulMayuri Nehul
Hi Shweta,

Thanks for your reply.
I will go through these documents will get back to you if I have any doubts on it.
Appreciated your help.

Thank you