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
John BrodrickJohn Brodrick 

VF page not refreshing in LEX when child record created

VF page not refreshing in LEX when child record created
Create a visualforce page that will override a standard salesforce detail page for a custom object.  On that visualforce page include the detail section as well as related lists.  Configure the view button to use the VF page as an override instead of the standard page.

Now when navigating to the page (view the object) in lightning experience, scroll to one of the related lists.  Click the new button on the related list.  The lightning experience record create popup will appear, you fill out required information and click save.  The child record is successfully inserted into the database but the visualforce override page for the parent does not refresh to show the new child record in the database.  You have to manually refresh the page.  No clue on a workaround to this - seems like a bug.

 
Best Answer chosen by John Brodrick
Khan AnasKhan Anas (Salesforce Developers) 
Hi John,

Greetings to you!

This is a known issue. Keep watching this issue until get fixed.

https://success.salesforce.com/issues_view?id=a1p3A0000001C8QQAU&title=data-not-updated-in-ui-after-an-apex-update-in-lightning-experience (https://success.salesforce.com/issues_view?id=a1p3A0000001C8QQAU&title=data-not-updated-in-ui-after-an-apex-update-in-lightning-experience)

You can select the 'This Issue Affects Me' button to report your account and receive updates.

You can create a Lightning action button for record detail page with a custom lightning component, and use following component code to refresh your page.

Component:
<aura:component implements="force:lightningQuickAction">
   <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>  
    refreshing.....
</aura:component>

Controller:
({
 doInit : function(component,event,helper){
   $A.get('e.force:refreshView').fire();
 },
 
})

Please refer to the below link which might help you further.

https://salesforce.stackexchange.com/questions/231359/lighting-experience-related-list-not-updated-when-new-is-overridden-to-use-a-v

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas

All Answers

Khan AnasKhan Anas (Salesforce Developers) 
Hi John,

Greetings to you!

This is a known issue. Keep watching this issue until get fixed.

https://success.salesforce.com/issues_view?id=a1p3A0000001C8QQAU&title=data-not-updated-in-ui-after-an-apex-update-in-lightning-experience (https://success.salesforce.com/issues_view?id=a1p3A0000001C8QQAU&title=data-not-updated-in-ui-after-an-apex-update-in-lightning-experience)

You can select the 'This Issue Affects Me' button to report your account and receive updates.

You can create a Lightning action button for record detail page with a custom lightning component, and use following component code to refresh your page.

Component:
<aura:component implements="force:lightningQuickAction">
   <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>  
    refreshing.....
</aura:component>

Controller:
({
 doInit : function(component,event,helper){
   $A.get('e.force:refreshView').fire();
 },
 
})

Please refer to the below link which might help you further.

https://salesforce.stackexchange.com/questions/231359/lighting-experience-related-list-not-updated-when-new-is-overridden-to-use-a-v

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
This was selected as the best answer
John BrodrickJohn Brodrick
Hi Khan-

I saw both of those links and yes the issue is very similar but slightly different. 

The existing known issue you linked has a Lightning detail that navigates to a VF page.  Ours is the opposite.

In our issue we are on a VF override page, then click new on a related list which brings up the lightning create popup.  After creation the popup closes and the VF page doesn't refresh. 

Thanks for the input though.  I also put a case in with Salesforce help becuase I think it is a similar bug.  Hopefully they can address this slightly different use case with their fix for the other issue.
John BrodrickJohn Brodrick
I have heard back from salesforce support and they also mentioned that it is part of a known issue and to wait until it is fixed.