0

In a Aura component I have save button and on click of it, server side controller is called and a checkbox on lead is updated to true which is initially false. Then in the callback of client side controller, We are navigating to the record detail page of the lead which was just updated using server side controller.

Then on lead record detail page there is LWC that uses LDS to just display that field.

The issue is the value of the check box field some times comes up as false. And after refreshing the page once or twice the updated value(true) is seen on detail page. How to get rid of this inconsistent behavior and the updated value is immediately seen on UI!!

Can someone help me here. I'm attaching a sample code below.

Aura.cmp Aura.cmp

Aura.js Aura.js

Aura.apxc Aura.apxc

LWC.html enter image description here

LWC.js LWC.js*emphasized text*

6
  • fire refresh view method from the aura component after you update the lead Commented Apr 15, 2020 at 6:45
  • Thanks I had added '$A.get('e.force:refreshView').fire();' after firing navigate event. But that didn't help. Commented Apr 15, 2020 at 7:06
  • Try iring it before the navigate event Commented Apr 15, 2020 at 7:17
  • Tried both and that also didn't work!! Commented Apr 16, 2020 at 9:59
  • I would suggest you put the actual and relevant code here, instead of the screenshots, also use the {} button to format code. Commented Apr 16, 2020 at 10:41

1 Answer 1

0

force:refreshView even after adding multiple times in the code after navigate and before navigate was not giving consistent result. So I added a setTimeout of 100ms after navigate and then did a force:refreshView.

You must log in to answer this question.

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