• Reshma Mohandas
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
On my community page(A) I have a LWC component with a button which onclick will call an apex method to create a record. If the create is successfull it needs to redirect to another community page(B). Onclick calls the method handleConfirm.
The issue I am facing is though the record is created/saved succesffully in the backend, the system doesn't redirect to the community page B. It remains on community page A.
Through debug, I confirmed the code under the handleConfrim .then does get executed but nothing happens.    
Below is the code snippet.
connectedCallback() {
        this.prod = something;
        getAsstPrgmLst({aId:this.prod})
        .then(result => {
            // does something in a for loop to populate some options.
        })
        .catch( 
            error => {
                this.error = error;
            })
        .finally(() => this.showflag = true );
    }

handleConfirm(){
        createSubscription({aId: this.asstPgm.Id,
        ep:this.prgm, uId: this.userId})
        .then(result=>{
            this.isSuccess = true;
            this[NavigationMixin.Navigate]({
                type: 'comm__namedPage',
                attributes:{
                    pageName:'connectpageB'
                }
            });
        })
        .catch(error =>{
            this.error = error;
        });
        
    }

What I am doing wrong here? Any suggestions on how I could fix this issue.
While transferring the opportunity ownership, is there a way to Keep Opportunity Team checkbox automatically checked in lightning interface.   
In classic, we have achieved this by overriding the "View" link but wondering how this could be achieved in lightning interface. Is there way to do this without having to create a new custom lightning page to override the standard opportunity lightning page?