LWC Force Refresh Wire getRecord

Today changes to cross-record summary fields, like rollups, are not detected by Lightning Data Service. We're actively working on a feature whereby Lightning Data Service (and all of its @wire adapters) will automatically provision a new version of records when such fields change regardless of the technology that triggered the change: LWC, Aura, Visualforce, Apex, triggers, etc. This means your components are reactive to record data changes regardless of the source. This also eliminates your need as a developer to know when to refresh which records. There's an open pilot for this; contact your account / support manager to join the Live Records pilot.

If Lightning Data Service detects a record is deleted then @wire(getRecord) uses will provision an error object with status code 404 (resource not found). Detection works if it's done using deleteRecord() in LWC or force:recordData's deleteRecord() method in Aura.


I believe the issue is that you're using the wire service which requires your aura enabled method to cache results. You should be able to use refreshApex to get the desired effect. Something like the below should do the trick.

import { LightningElement, track, wire, api{ from 'lwc';
import { refreshApex } from '@salesforce/apex';
import fetchAccount from '@salesforce/apex/testComponentController.fetchAccount';
export default class TestComponent extends LightningElements {
    @track accountId;
    @track acc;
    @wire(fetchAccount,{param1:'$accountId'})
    someFunction(result){
        if(result.data) this.account = result.data;
    }

    someOtherFunction(){
        refreshApex(this.acc);
    }
}