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
Cícero SchoepsCícero Schoeps 

Add record to list record directly

Hi, Guys!

Is there a way of adding a record in a list record directly? The user doesn't want to call a record form by clicking on "New" button. The data should be entered directly in a new row in the list itself without any screen refresh or navigation.

Thanks
Best Answer chosen by Cícero Schoeps
Maharajan CMaharajan C
Hi,

There is no standard way for this.  You have to create the custom component or code to achiecve this functionality.

In the below link i have created the dynamic new lwc form to add multiple records so use the funtionality for you reference. Create the new code In the same way to load the existing records on page load and add the new button functionality to add the rows for new record while click the save upsert the records or insert the rows.

https://developer.salesforce.com/forums/ForumsMain?id=9062I000000Xw8WQAS

Thanks,
Maharajan,C

All Answers

Maharajan CMaharajan C
Hi,

There is no standard way for this.  You have to create the custom component or code to achiecve this functionality.

In the below link i have created the dynamic new lwc form to add multiple records so use the funtionality for you reference. Create the new code In the same way to load the existing records on page load and add the new button functionality to add the rows for new record while click the save upsert the records or insert the rows.

https://developer.salesforce.com/forums/ForumsMain?id=9062I000000Xw8WQAS

Thanks,
Maharajan,C
This was selected as the best answer
VinayVinay (Salesforce Developers) 
Hi Cicero,

You would need to implement custom logic to achieve above functionality.

Review below links which can help you.

https://salesforcediaries.com/2020/06/11/adding-or-removing-rows-dynamically-in-lightning-web-component/
https://www.forcetalks.com/blog/how-to-add-or-delete-dynamic-rows-in-salesforce-using-lightning-web-component/
https://sfdcmonkey.com/2017/08/09/add-delete-rows-dynamic/

Thanks,
Vinay Kumar
Cícero SchoepsCícero Schoeps
Thank you for helping, Maharajan C and Vinay Kumar