4

I have an auto launched flow that updates the Status of the Case to be closed when the button is clicked. The flow is like below enter image description here

I am calling the flow through the Detail Page Button using the URL like

/flow/Close_Case_Autolaunched?recordId={!Case.Id}&retURL={!Case.Id}

With the return URL set after the flow completed it does return back to the Page but the page is not refreshed it just shows old status and when manually do a refresh it shows the Closed status. The flow does update the record but but the page is not being refreshed. How can we handle this

5 Answers 5

3

This can be solved using a component from Unofficial SF (which is managed by the SFDC Flow PM)

The component is Update Screen

Add it as the last element of your flow

enter image description here

There's lots of cool stuff at Unofficial SF that makes flows work better and more user-friendly

5
  • 2
    i think this wont work for autolaunched flow ?
    – User6670
    Apr 3, 2020 at 7:30
  • Can you make it a simple screen flow with just a Display Text element?
    – cropredy
    Apr 3, 2020 at 14:03
  • Simple display text, do you mean like a toast? I am trying to minimize the user clicks can we have the display text with no user clicks ?
    – user81642
    Apr 6, 2020 at 9:56
  • No, I meant a Screen that says something like "You are about to do xxxx, press Next to continue"
    – cropredy
    Apr 7, 2020 at 3:14
  • @cropredy I tried using this component in my flow but i dont get the record page refreshed I posted the question here salesforce.stackexchange.com/questions/302508/… can you please help me what I am missing
    – user81642
    Apr 14, 2020 at 19:09
2

Yes, you are not able to trigger the action for the Update Screen from an auto launched flow, but a workaround is to create a Screen Flow with just 1 action for the Update Screen and nothing else. Then in your button url have the retURL reference the Screen Flow with the Update Screen first, then add another retURL for the record! This worked perfectly for me and shows the refreshed screen!

Example for the Button:

/flow/Account_Copy_Address?recordID={!Account.Id}&retURL=/flow/Update_Record_Screen?recordID={!Account.Id}&retURL=/lightning/r/Account/{!Account.Id}/view

2

Unfortunately, the UnofficialSF solution didn't work for me, but was able to get a similar solution working.

Similar to the UnofficialSF component, add the following aura component to your flow where you want the refresh to occur.

RefreshView.cmp
<aura:component implements="lightning:availableForFlowActions,force:hasRecordId">
    <!-- no markup needed -->
</aura:component>
RefreshViewController.js
({
    invoke : function(component, event, helper) {
        $A.get('e.force:refreshView').fire();
    }
})

Add it to your flow as shown below; takes no inputs. Should be good to go after this.

enter image description here

1

I think Adding a Confirmation Screen at the end ("User can click 'finish' which will refresh the flow) and Also Adding a Screen in the beginning with something like "Press Next to Continue" will solve this.

0

Hello Salesforce Ohana!

If this questions is still open, please check the approach below. To refresh the screen/page at the end of the flow or after clicking the Finish button, follow the steps below.

  1. Create an Aura Component
  2. Add the extesions needed in the CMP file(lightning:availableForFlowActions in this case). PFA supporting screenshot.
  3. Add the Invoke method with just a line. PFA supporting screenshot.
  4. Add this component in the flow as the last element. Use Action flow element for the same. Drag the Action element and add Aura Component created in #1. PFA supporting screenshot.
  5. Save and Activate the flow

Now, whenever the flow ends, the page would be refreshed successfully.

enter image description here

enter image description here

enter image description here

Thanks in advance. Please let me know when it works!

1
  • Firstly, please do not post code as screenshots - it is not as accessible to users who use screen readers or other assistive technology. Plus it makes it harder for anyone to copy/use your code. Instead, type or copy/paste the code into the SFSE editor & format it as a code block. Secondly, your answer is very similar to Charles Naccio's answer - the (only seemingly significant) difference being that in the controller you call window.location.reload() rather than $A.get('e.force:refreshView').fire();. It would be helpful if you could elaborate on how your option is better/different.
    – Moonpie
    Jul 7 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.