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
NLTNLT 

Error on inline edit for the list of records in lightning web component

Hi All, When i try to do inline edit for the list of records in LWC component as shown in the below screenshot, It reload the pop up window again instead of allowing me to submit as shown in 2nd screenshot.  Below is code for handleSave function, please correct if anything is wrong.

User-added image

User-added image

//Enable Inline Editing for Multiple Rows
    handleSave(event) {
      const recordInputs =  event.detail.draftValues.slice().map(draft => {
          const fields = Object.assign({}, draft);
          return { fields };
      });
 
      const promises = recordInputs.map(recordInput => updateRecord(recordInput));
      Promise.all(promises).then(OpportunityLineItems => {
          this.dispatchEvent(
              new ShowToastEvent({
                  title: 'Success',
                  message: 'Products updated',
                  variant: 'success'
              })
          );
           // Clear all draft values
           this.draftValues = [];
 
           // Display fresh data in the datatable
           return refreshApex(this.OpportunityLineItem);
      }).catch(error => {
          // Handle error
      });
  }


Thanks.
mukesh guptamukesh gupta
Hi Lakshman,

Please follow below url:-

https://www.w3web.net/record-save-edit-field-inline-in-lwc/

if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh