Salesforce Decode
Salesforcedecode
Back to questions
LWCAdvanceddatatableinline-edit

Implement lightning-datatable inline edit with Apex save

Real World Scenario

Users edit 20 rows inline but save fires 20 separate Apex calls causing limit errors.

Expected Answer

• Batch save on Save button collecting draftValues • Single Apex method accepting List<RowUpdate> • Cell-level validation before batch submit • Optimistic UI rollback on partial failure • Loading state on table during save • FLS check server-side on bulk update

Follow-Up Questions & Answers

Click to expand — each follow-up includes a direct, interview-ready answer

Stay within limits by: Batch save on Save button collecting draftValues. Bulkify everything — never query or DML in loops. Cell-level validation before batch submit. Inline edit implies bulk save contract—never one DML per cell blur. Optimize for scale and operational observability.

Architect Perspective

Inline edit implies bulk save contract—never one DML per cell blur.