0

Is there a way to navigate from a Modal window inside a screen flow into the next screen?

The use case: We are using a Modal lwc inside a screen flow. The Modal has two buttons [Cancel, Next]. The "Cancel" supposed to close the Modal, and the "Next" supposed to navigate the user into the next screen in a screen flow.

SCREENFLOW

enter image description here

HTML

<template>
    <lightning-modal-header label='Please click on a button below'><br><br></lightning-modal-header>

    <lightning-modal-footer>
        <div class="slds-m-top_small slds-align_absolute-center">
            <lightning-button 
                variant="Neutral" 
                label="Cancel" 
                class="slds-m-left_x-small" 
                onclick={handleClose}>
            </lightning-button>
            
            <lightning-button 
                variant="brand" 
                class="slds-m-left_x-small" 
                label="Next" 
                onclick={handleSave}>
            </lightning-button>
        </div>
    </lightning-modal-footer>
</template>

JS

import LightningModal from 'lightning/modal';

export default class MyModal extends LightningModal {

    handleClose() {
        this.close('done');
    }

    handleSave() {
    }
}

JS-META

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>56.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__FlowScreen</target>
    </targets>
</LightningComponentBundle>

What should we add after the handleSave() in JS to make the user navigate into the next screen?

Thank You

1 Answer 1

1

Could you perhaps use FlowNavigationNextEvent

https://developer.salesforce.com/docs/component-library/bundle/lightning-flow-support/documentation

1
  • 2
    Thanks for trying to contribute to SFSE! What you've provided here is more of a comment than an answer (you'll be able to comment like this once you've got some reputation) and I would encourage you to elaborate what you've posted, pointing out the specific events that could be used and show example code in the context of the OP's code samples to guide the OP on the way. Cheers!
    – Phil W
    May 3, 2023 at 16:40

You must log in to answer this question.

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