1

i am trying to create a custom footer for a flow. While trying to navigate to a list page of Survey object the Navigation is not working, Any help would mean a lot.

Thanks!!

<template>
    <div>
        <footer class="slds-modal__footer"  >
        <lightning-button class="slds-m-right_small"  label="Navigate to Survey" onclick={navigateToListView} >
        </lightning-button>
        <lightning-button class="slds-m-left_small"  label="Next" onclick={handleGoNext}>
        </lightning-button>
    </footer>
    </div>   
</template>


import { LightningElement, api } from 'lwc';
import { FlowNavigationNextEvent } from 'lightning/flowSupport';
import { NavigationMixin } from 'lightning/navigation';

export default class IDS_SendSuveryfooter extends LightningElement {



    handleGoNext() {
            console.log('next event fired')
                //     if (this.availableActions.find((action) => action === 'NEXT')) {
                // navigate to the next screen
            const navigateNextEvent = new FlowNavigationNextEvent();
            this.dispatchEvent(navigateNextEvent);
        }
        //}


    navigateToRecord() {
        console.log('navigate event fired')
            // Navigate to the Contact object's Recent list view.
        this[NavigationMixin.Navigate]({
            type: 'standard__objectPage',
            attributes: {
                objectApiName: 'Survey',
                actionName: 'list'
            },
            state: {
                filterName: 'Recent'
            }
        });
    }
}


1 Answer 1

2

For NavigationMixin we need to follow this format in the .js:

 export default class IDS_SendSuveryfooter extends NavigationMixin(LightningElement) {
    ......
    }

Follow the documentation for more information: https://developer.salesforce.com/docs/component-library/bundle/lightning-navigation/documentation

2
  • Yeah, i clocked it. Made a rookie mistake. – Thanks Might guy!! Commented May 11, 2022 at 12:50
  • No problem mate. Do accept the answer if it helped you. :-)
    – Night Guy
    Commented May 11, 2022 at 13:42

You must log in to answer this question.

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