18

force:recordPreview had a ignoreExistingAction attribute that would force a server trip. I have an issue right now where I have two components:

  1. Comp A - Contains a list of sObjects, saves/updates using custom code.

  2. Comp B - Single component with force:recordData, that will display details from one of the records in the Component A's list.

Right now, if CompA saves a record, and ComponentB had loaded the the record in question at any point, subsequent inits of ComponentB draw from the stale cache.

Any ideas?

3
  • Have you tried force:refreshView?
    – sfdcfox
    Sep 22, 2017 at 20:14
  • yes. The problem is this on the homepage and that causes the whole page to refresh, which I don't want.
    – wellmstein
    Sep 22, 2017 at 20:27
  • Supposedly, you can use reloadRecord on a force:recordData, but that might be a winter 18 thing, since I can't seem to get it working in my dev org.
    – sfdcfox
    Sep 22, 2017 at 20:45

1 Answer 1

23

ok - reloadRecord takes 2 undocumented arguments

reloadRecord(skipCache, callback)

so you can just do a

cmp.find('recordData').reloadRecord(true) 

on init, or whenever you need.

1
  • If you do this on onInit, how do you prevent recursive behavior of endlessly reloading itself? May 7, 2019 at 21:07

You must log in to answer this question.

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