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
Mangi S V V Satya Surya Sravan KumMangi S V V Satya Surya Sravan Kum 

Refreshing a Lightning Aura component when a record is updated via the standard Salesforce UI

there is standard record detail page for an object and
 i also create one custom lightning aura component for record detail page
 now my requirement is that
whenever i change value in standard page that update should reflect on custom lightning record detail page how we can do this
 
V V Satyanarayana MaddipatiV V Satyanarayana Maddipati
Hi Sravan,

By using Lightning Data Services(force:recordData tag), we can achieve this . whenever record is updated from standard detail page, recordUpdated event will be fired automatically in the custom lightning aura component which is placed in same page.

Use below code to identify the update event from standard page.
Add below code in aura Component - .cmp
<force:recordData aura:id="recordLoader"
                      recordId="{!v.recordId}"
                      layoutType="FULL"
                      targetRecord="{!v._record}"
                      targetFields="{!v.sobjectRecord}"
                      targetError="{!v._error}"
                      recordUpdated="{!c.handleRecordUpdated}"/>

Add below code in Controller.js -

handleRecordUpdated : function(component, event, helper) {
        var eventParams = event.getParams();
        if(eventParams.changeType === "CHANGED") {
            var changedFields = eventParams.changedFields;
            console.log('Fields that are changed: ' + JSON.stringify(changedFields));
            component.find("recordLoader").reloadRecord(); // refresh the whole component.
        }
    }
Refer below link for more details.
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/data_service_handling_record_change.htm (https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/data_service_handling_record_change.htm" target="_blank)