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
Emily PhillipsEmily Phillips 

Refresh record after flow?

I have a custom button on a page layout that is linked to a flow. I've added the retURL parameter to the flow link in order to return back to the record wherein the flow was initiated. The record is not being refreshed once the flow is complete. I have to manually refresh the record in order to see the changes made by the flow. Is there a way to automatically refresh a record once a flow has finished? I'm using the Lightning, not Classic. Thank you!
ShirishaShirisha (Salesforce Developers) 
Hi Emily,

Greetings!

Yes,you can refresh the record page using the dummy lightning component which will refresh the page whenever there is any action.Please use the below sample code to create the lightning component and place it in the record page to make it work.

https://developer.salesforce.com/docs/component-library/bundle/force:refreshView/documentation

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.

Warm Regards,
Shirisha Pathuri
Emily PhillipsEmily Phillips
Hi Shirisha, 

Thank you for the reply. Do I need to use the sample code and create a lightning component then add that component to my flow? I'm very new to Lightning Components and Core Actions in flows. 

Thank you!
ShirishaShirisha (Salesforce Developers) 
Hi Emily,

You do not need to add the compenent to the flow.We just have to place it on the record page of the Object on which you are invoking the flow.

Once,you create the lightning component then go to the record page and click on the gear icon and got to the edit page.Once,the page opens then select the lightning component which you have created from the left side under the custom components then drag and drop it anywhere in the record page.

Then,you can save the record page which will not show you any difference however,it will refresh the page whenever you open it or any operation performs on the record.

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.

Warm Regards,
Shirisha Pathuri
Emily PhillipsEmily Phillips
Hi Shirisha, 

Can you please provide the code to create the component? It appears the code from the link you provided goes in the controller element of the component. I'm stuck on how to build out the rest of the component. I appreciate your help!
Emily PhillipsEmily Phillips
Hi Shirisha, can you please help with building the component? I'm not sure where to start. Thank you!
ShirishaShirisha (Salesforce Developers) 
Hi Emily,

The below document will give you the steps to create the lightning component:

https://trailhead.salesforce.com/en/content/learn/projects/workshop-override-standard-action/override_1

I would suggest you to reach out to the accelerator team who can give you the idea on how you can implement according to your business requirement,if you have premier success plan.

Please find the details on how to request for an accelerator:https://help.salesforce.com/articleView?id=000337601&type=1&mode=1

Otherwise,I would request you to reach out to your account Executive If you wish to upgrade to Premier Support please contact your Account Executive.

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.

Warm Regards,
Shirisha Pathuri




 
Emily PhillipsEmily Phillips
Hi Shirisha, 

I believe I got the component working. However, I noticed the buttons on my page layout do not update/refresh. My flow updates a record by changing the record's Record Type and subsequently, the page layout. The page layout changes but the buttons do not. Have you encountered this issue before and might you have a workaround? 

Thank you and take care!
Scott Miller 82Scott Miller 82
Would love to know how you resolved this!