I have LWC which was deployed almost 2 months before. Before WI 21 updates, it was working correctly but after installing critical updates, its not calling controller class methods from wire service. This issue is observed in all environments including production

As per below link, I have enabled Apex Class permission at profile level:



but even after adding controller class to profile, LWC is still not working.

In browser console, I am observing below message:

beaconLib.BeaconLibrary.js:formatted:766 {InstrumentationResult : ( RECEIVED = 9 , SUCCESS -> LOG = 9 , Topic = AILTN ) , TracingResponse : ( AsyncResults ) , TelemetryResponse : ( AsyncResults ): {…}}

above message was never observed earlier. Problem is wired service is not even calling controller class method at all. There is no debug log I am getting.

In order to investigate the issue, instead of wired service, I am calling controller class method on a button(Imperatively) and its making server call. So it looks like Wired Service is not getting called again if I provide input from UI. It calls only once when page loads.

Code is mentioned on below link:

How to pass lightning-input-field value as a parameter to controller class method in Lightning Web Component

Below is modified JS where I added wired service which makes server call:

import {
    } from 'lwc';
    import {
    } from 'lightning/platformShowToastEvent';
    import refreshObjList from '@salesforce/apex/ReassignSObjectHelper.refreshObjList';
    export default class MassReassignSObjectParent extends LightningElement {
        @track items = []; //it contains all the records.
        @track sObjects; //data to be display in the table
        @track error;
        objType = '';
        owner = '';
        @wire(refreshObjList, {
        objType: '$objType',
        owner: '$owner'
    wiredCallback(result) {
        console.log('Calling Wired'); // When Page loads. This gets called. but if I provide objType& owner from UI then wired does not call at all
        this.items = [];
        this.sObjects = '';
        //this.allSelectedRows = [];
        //this.assignRecords =[];
        this._wiredResult = '';
        this._wiredResult = result;
        console.log('Setting Wired Result Data' + this._wiredResult);
        if (result.data) {
            console.log('Result count' + result.length);
            //this.items = result.data;
            let nameUrl;
            let ownerText;
            let currentPage;
            this.items = result.data.map(row => {
                    /*I'm Commenting this part for now. as it display data in table based onm the result I want to see. This part is not commented in real. Wanted to show only Basic wire service which is not getting called at all.
                    nameUrl = `/${row.Id}`;
                    ownerText = `${row.Owner.Name}`;
                    currentPage = Math.ceil(recCount++/ this.pageSize);
                        return {
                    this.totalRecountCount = this.items.length; 
                    console.log('Total Record Count:' + this.totalRecountCount); 
                    this.totalPage = Math.ceil(this.totalRecountCount / this.pageSize); 
                    console.log('Total Page to be displayed:' + this.totalPage);
                    this.page = 1;
                    this.startingRecord = 1;
                    this.sObjects = this.items.slice(0, this.pageSize);
                    this.endingRecord = this.pageSize;
                    console.log('Ending Record page size is:' + this.endingRecord);
                if (this.totalRecountCount == 0) {
                    //Display No Result Message when click on Serach Button after completing wire event
                    this.isServerCallComplete = true;

            else if (result.error) {
                this.items = undefined;
                    toastMessage('error', 'dismissable', 'Error', 'Exception Occured While Retrieving Records.Please check error logs for more details')
        handlePickChange(event) {
            this.objType = event.target.value;
            console.log('objType:' + objType);
        handleChange(event) {
            this.owner = event.target.value[0];
            console.log('owner:' + owner);
        //this method is fired when retrieve records button is clicked
        handleSearchClick(event) {
            console.log('Clicikng on Search:');
            const val = event.detail.value;
            console.log('Search Val is:' + val);
            this.template.querySelectorAll('lightning-input-field').forEach(element => {
                console.log('Element is:' + element.detail);
            if (this.items.length > 0) {
                this.sObjects = this.items.slice(0, this.pageSize);
                this.endingRecord = this.pageSize;
                console.log('Ending Record page size is:' + this.endingRecord);
                // this.sObjects = this.records;
            } else {
                console.log('No Results:' + this.isServerCallComplete);
                if (this.isServerCallComplete) {
                    console.log('Server Call Complete Displaying No Result Message');
                        toastMessage('info', 'dismissable', 'Search Result', 'No Records Found')

           /* Shift logic to wired service
                    objType: objType,
                    owner: owner
                .then(result => {
                    this.sObjects = result;
                .catch(error => {
                    this.error = error;
            handleResetClick(event) {
                const inputFields = this.template.querySelectorAll(
                if (inputFields) {
                    inputFields.forEach(field => {

only changes I made in the code is instead of calling controller class method on button, I am using wired service here.Controller Class method is cacheable.

Has anyone observed the issue after critical updates for LWC?

  • @wire methods works in user context. can you please check and ensure that users have FLS on the fields and objects @wire methods are calling. Commented Oct 19, 2020 at 15:52
  • @maniaccoder FLS is correct on both fields an object. Problem is when I load components, wire service calls only once. But as soon as I pass parameter from UI, it does not get call. This did not happen earlier. Its not even calling controller class method even when page is loaded.
    – SFDCDJ
    Commented Oct 19, 2020 at 16:01
  • Is it consistent across other sandboxes? can you try to deduce to smaller version of code. like helloworld may be, which will help to understand is it SF issue or something is missed at your side.
    – Ysr Shk
    Commented Oct 19, 2020 at 16:35
  • Yes its consistent everywhere. below is the link where i posted code earlier when I was new in LWC.Instead of calling it on button(implicitly), I am using wire service now. so that based on input field selection, it displays results. Let me know if the code helps.I have removed with sharing from my controller class.Rest of the code is same salesforce.stackexchange.com/questions/310434/…
    – SFDCDJ
    Commented Oct 19, 2020 at 16:41
  • Can you check if Apex class permission is also available in the profiles ? releasenotes.docs.salesforce.com/en-us/winter20/release-notes/… Commented Oct 20, 2020 at 6:51

1 Answer 1


You are probably facing a stale cache. When using wire property with apex methods, the wire property does not always do a server trip-

If an Apex method is marked with @AuraEnabled(cacheable=true), when it’s invoked imperatively or via @wire, a client-side Lightning Data Service cache is checked before issuing the network call to invoke the Apex method on the server. However, data provisioned by Apex is not managed by Lightning Data Service. If you use @wire to call an Apex method, to refresh stale data, call refreshApex().

To refresh Apex data provisioned via a wired Apex method, call refreshApex(). The function provisions the data using the configuration bound to the @wire and updates the cache.

When the wire service provisions data via a Lightning Data Service wire adapter like getRecord, it provisions new values when they’re available. However, when the wire service provisions data via an Apex method, it doesn’t provision new values, so you must call refreshApex().

Using refreshApex should resolve the issue - https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.apex

  • I use refreshApex when I update the data. Here I did not post the complete code but when Update the records, I use refreshApex to call wireService to update the fresh data. Just wanted to ask you what is you recommendation about defining variable with propert track objType, track owner which I did not define earlier? Can you please suggest about the variable scope?
    – SFDCDJ
    Commented Oct 20, 2020 at 12:00
  • instead of a property, you could use a setter/getter. When the setter is called, you can call refreshApex to get the latest data ( this will happen asynchronously, so use a spinner if you need to).
    – Nagen Sahu
    Commented Oct 20, 2020 at 12:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .