0

Context - I am using an LWC Datatable to visualize data, which has a 'Modify' action that loads the row into a lightning-record-edit-form dynamically (when clicked). After modifying the data, saving it and then clicking modify again, the lightning-record-edit-form shows the old values (like a dirty flag is not being respected).

Question - How do I get the new version of a record without refreshing the page in LWC?

<lightning-record-edit-form object-api-name="Case"
  record-id={DynamicallyLoadedId}>

In the above edit form, I am loading a Case record via swapping out the DynamicallyLoadedId. When I load the record a second, third, fourth time, the original page load values remain. I want to get the newly saved version of the Case object, without refreshing the entire page.

1
  • This service uses the same cache as the uiRecordApi getRecord service. If you use an (at)track property with the getRecord wire, you can use refreshApex in your onsuccess handler of the form to force refresh of that cache. Check developer.salesforce.com/docs/component-library/documentation/… for some info on "refreshing the cache".
    – Phil W
    Sep 14 '19 at 8:44
0

I ended up writing custom Apex and stripping out the submit button.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.