Okay, i'm looking to see if I can get some help in understanding the documentation as laid out here: https://developer.salesforce.com/docs/component-library/documentation/lwc/reference_salesforce_modules
I want to refresh a component after a record CRUD operation, the form is being populated from a call to an apex method. The data from this method (called with the @wire service) is then passed into a js function that splits the data into complete and incomplete todo items. Wire service call is:
@wire(getTodos, { searchKey: '$searchString' }) sendForSplitting({ error, data }) { if (error) { this.error = error; } else if (data) { this.splitTodos(data); } } In an event handler i want to trigger an update to this dataset, the documentation above seems to reference that I can refresh the apex on a wired method. From that doc:
To refresh a wired method, you must pass the argument the wired method receives (which is the wired value).
To date, I have tried both:
handleCreate() { return refreshApex(getTodos, { searchKey: '$searchString' }); } and
handleCreate() { return refreshApex(this.sendForSplitting({ error, data })); } Both of which throw errors - refresh failed because configuration is not available. How can I make this work? I want to ensure the lists update upon user interaction without having to resort to a manual refresh of the page...