function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Lightning Page Refresh component erroring out

We have a lightning page where a section is getting updated via a third party webservice. In order to show the updated values, we have a lightning component to refresh the page once the values are updated. However, this page is currently throwing the below error.
Uncaught Error in A$.getCallback() [Cannot read property 'reloadRecord' of undefined]

The code is given below.
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<aura:attribute name="dataRecord" type="Object"/>
<aura:attribute name="recordSaveError" type="String" default=""/>
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<force:recordData aura:id="recordLoader" recordId="{!v.recordId}" layoutType="FULL" targetFields="{!v.dataRecord}" targetError="{!v.recordSaveError}" recordUpdated="{!c.handleRecordUpdated}" />
<aura:if isTrue="{!not(empty(v.recordSaveError))}">
<div class="recordError">

doInit: function(component,event,helper){
    //set time-out

    handleRecordUpdated: function(component, event, helper) {
    var eventParams = event.getParams();
    if(eventParams.changeType === "CHANGED")
        // get the fields that are changed for this record
        var changedFields = eventParams.changedFields;
        // record is deleted and removed from the cache
    } else if(eventParams.changeType === "ERROR") {

setTimer:  function(component){
var that = this;
        $A.getCallback(function() {
    }),1000 //time after which the component reloads to check for any change in the record data

The same code works fine in Dev sandbox, but not in QA sandbox. Can someone help?
ShirishaShirisha (Salesforce Developers) 


You can debug the lightning component using the lightning inspector to narrow down the code to figure out the root cause of the issue.

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri

I get this error message when I try to view the page.

Lightning Inspector Page.

Is there a video or something else that can help me to debug this issue?