I have a Lightning Web Component that uses NavigationMixin to allow inline object creation of a task:

 onClickNewTask(event) {
      let nav = {
          type: 'standard__objectPage',
          attributes: {
              objectApiName: 'Task',
              actionName: 'new'                
          state : {
              defaultFieldValues:"WhatId=" + this.recordId,
              navigationLocation: 'RELATED_LIST'

This opens a modal for creating a Task and allows the user to create a task from that modal. Now I want to refresh some data once the user finishes creating that task. Is there a callback/event handler I can attach?

1 Answer 1


As per documentation, The navigation service adds two APIs to your component's class.

  1. [NavigationMixin.Navigate](pageReference,[replace])
  2. [NavigationMixin.GenerateUrl](pageReference)

A component calls this[NavigationMixin.GenerateUrl] to get a promise that resolves to the resulting URL but you will not get any promise by using [NavigationMixin.Navigate](pageReference,[replace])

You must log in to answer this question.

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