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
SimmoSimmo 

Using the PageReference setRedirect method in Lightning Experience but not showing updated values?

Hello,

I have an Apex controller that updates a Case record then redirects back to a Case Lightning Record Page. Although the redirect to the Case page is successful, the values on the page are not refreshed, so still showing the old values?

I am using the code below:

        PageReference retURL = new PageReference('/lightning/r/Case/' + updatedCase.Id + '/view');
        retURL.setRedirect(true);
        return retURL;

I don't understand why it would navigate to the Case Lightning Page but not display the latest values?

Anybody had similar issues, if so how did you resolve this?
 
Best Answer chosen by Simmo
SandhyaSandhya (Salesforce Developers) 
Hi,

This is a known issue which has been raised, refer below link.

https://success.salesforce.com/issues_view?id=a1p3A0000001C8QQAU&title=data-not-updated-in-ui-after-an-apex-update-in-lightning-experience
 
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
                                             
Best Regards
Sandhya
 

All Answers

SandhyaSandhya (Salesforce Developers) 
Hi,

This is a known issue which has been raised, refer below link.

https://success.salesforce.com/issues_view?id=a1p3A0000001C8QQAU&title=data-not-updated-in-ui-after-an-apex-update-in-lightning-experience
 
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
                                             
Best Regards
Sandhya
 
This was selected as the best answer
SimmoSimmo
Thanks Sandhya, that explains why I'm getting the issue.
 
Anupama JanteAnupama Jante
Is there any workaround to this known issue ?