Skip to main content
case 'logacall': this[NavigationMixin.Navigate]

({ type: 'standard__objectPage',

attributes: { objectApiName: 'task', actionName: 'new' },

state : { defaultFieldValues:"WhatId=" + this.Id} });

break;

How to navigate to the Homepage after that save of new task, right now this takes to the new task record

 
1 réponse
  1. 2 oct. 2023, 11:03
    Hi Pooja,

    To navigate to the homepage after saving a new task record , you can use the NavigationMixin with the standard__home page reference type.

    You can refer below sample code:

    import { NavigationMixin } from 'lightning/navigation';

    // ...

     navigateToHomePage() {

            this[NavigationMixin.Navigate]({

                type: 'standard__namedPage',

                attributes: {

                    pageName: 'home'

                },

            });

        }

    Related:

    https://salesforce.stackexchange.com/questions/393248/how-to-navigate-user-to-home-page-after-logging-in-lwr-site-in-lwc 

    https://www.sfdcpoint.com/salesforce/navigation-service-in-lwc/

    Thanks
0/9000