0
  • I created a screen flow that I call from a quick action on the Case sObject.
  • I added a screen at the very end of the flow as the last element where I have some display text saying the case was cloned with a link to the newly created cloned case.
  • I hide the footer so the user can only click on the link to go to the cloned case or close the quick action.

If you click on the link to go to the cloned case, a new tab opens the cloned case in a new tab in the browser. However, the other window from where the case was cloned keeps the quick action open.

I read the documentation that I can control the flow behavior wrapping the flow in an aura component. However, I don't believe that will work because the user doesn't click the finish button since the footer is hidden. Is there a way to close the quick action when it reaches that final screen flow when the user clicks on the link that redirects them to the cloned case?

1 Answer 1

0

A workaround can be:-

  1. Create a lightning web component which has the link to the cloned case which you will add in the flow in last screen.
  2. You can control the finish behavior using FlowNavigationFinishEvent of lightning/flowSupport module
  3. You can redirect the user to the new case as well as fire the FlowNavigationFinishEvent to close the quick action of flow.

A sample example you can find here:- LWC in Flow, Also I am adding minimal required code:-

    import { LightningElement, api } from 'lwc';
    import { FlowNavigationFinishEvent } from 'lightning/flowSupport';
    import { NavigationMixin } from 'lightning/navigation';
    export default class LwcInFlow extends NavigationMixin(LightningElement) {
        @api caseId;
        @api availableActions = [];
        handleSuccess() {
            this.handleRefresh();
            this.NavigateToRecord();
        }
    
        handleRefresh() {
            if (this.availableActions.find((action) => action === 'FINISH')) {
                // navigate to the next screen
                const navigateNextEvent = new FlowNavigationFinishEvent();
                this.dispatchEvent(navigateNextEvent);
            }
        }
    
        NavigateToRecord() {
            //write your own js logic to navigate in a new tab
        }
    }

You must log in to answer this question.

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