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
Vaibhab ShahVaibhab Shah 

Inserting data into account object using lightning web component

Hi,
I have a requirment where I have to develop a lightning web component UI to insert more than 1 record into Account object by clicking Add Row button and then inserting all the records by clicking Submit button. Can anyone help me on this? 
Team NubesEliteTeam NubesElite
Hi,
Please try this way
https://www.salesforcecodecrack.com/2019/08/create-record-in-lightning-web.html



Thank You
www.nubeselite.com

Developement | Training | Consulting

Please Mark this as solution if your problem resolved.
Vaibhab ShahVaibhab Shah
Thanks for your reply!

Your shared link shows how to insert a record at a time. I want to insert more than 1 record at a time using lightning web component.

User-added image
Raghu NaniRaghu Nani
I think you have to change the single AccOBJ to list every where need to change the relevart code. I will try
Vaibhab ShahVaibhab Shah
How to acheive this in UI made of lightning web component?
 
Vaibhab ShahVaibhab Shah
When the application opens no row will be there in the table. On clicking the Add Row button, blank row will be created in the table where user will fill the details. There can be another button called Save. User will click on Save button and the all the rows will be saved in the account object.
Yes it has to be taken in the list to save. Tricky is to design the ui.
Khan AnasKhan Anas (Salesforce Developers) 
Hi Vaibhab,

Greetings to you!

Please refer to the below link which might help you further with the above requirement.

https://github.com/seanpat09/dynamicFieldsLWC

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
Vaibhab ShahVaibhab Shah
Hi Anas,

Thanks for noticing and taking your time out to reply and thinking about the community! It is really appreciable.

I can see there are 3 lwc components. Do I have to deploy all the sources to my org to check the functionality? Can't it be done on account or any sobject?

Rgds,
Vai
Vaibhab ShahVaibhab Shah
Hi Anas, Please let me know how to do it for Account object.

Rgds,
Vai
Pinaki Ghosh 18Pinaki Ghosh 18
Hi Anas and Vaibhab,

My requirement is almost same. Only thing is I want to add one lightning:combobox and lightning:checkbox in the columns of the datatable.
This means whenever a user will click on Add row, 1 row will be added with 2 columns as textbox, 1 column will be combobox(some  values like abc,xyz) and the other one will be checkbox.

Looking forward for your reply.

Thanks!
P