force:recordData “recordUpdated”: Detect Trigger/Workflow Changes

I’m using Lightning Data Service in a component. It all works well. One item I’ve noted is that it does not seem to detect changes to fields which may have occurred via a trigger or workflow after a standard record save for a component I have on my record detail page.
Should the “recordUpdated” function within force:recordData detect this?
If not is using component.find(“forceRecord”).reloadRecord() the recommended approach? If so how do I detect when to fire this?

Thank in advance (& apologies if the answer should be obvious but I have not noted one.)

Answer

According to this Trailhead Step

Use Lightning Data Service and Communicate Between Components

force:recordData automatically retrieves the record specified by its recordId attribute, and then stores that data in the <aura:attribute> defined by the targetRecord attribute. Then force:recordData begins to listen for changes to that record made by other components on the page, and fires the JavaScript function defined by the recordUpdated attribute when it detects a change.

You can use force:recordData with recordUpdated to make actions when detected a change in all the record fields.

Attribution
Source : Link , Question Author : RedQueries , Answer Author : ElkCor

Leave a Comment