I have a Visualforce page where clicking on a button triggers a popup of an LWC.
To achieve this, I encapsulated my LWC within an Aura component and invoked this Aura component within the JavaScript function tied to the "onClick" event.
Up to this point, everything is functioning perfectly.
However, I am currently attempting to incorporate a new feature.
After saving specific records to the Salesforce database, I intend to navigate to another VF page in order to continue the process for the client.
Regrettably, I am encountering an issue where nothing happens upon attempting this navigation.
There are no error messages or redirects occurring – the process simply remains stagnant.
If you could provide assistance in rectifying this matter, I would greatly appreciate it.
this is my JS on my LWC:
import {LightningElement, track,api} from 'lwc';
import { NavigationMixin } from 'lightning/navigation';
export default class manage extends NavigationMixin(LightningElement) {
async saveBtn(){
this.loaded=true;
await this.saveToDB(JSON.stringify(ListOfRecordsToSave)); // this funcition does save and return a success.
this[NavigationMixin.Navigate]({
type: 'standard__webPage',
attributes: {
url: '/apex/myVfPage'
}
});
}
}
the saveBtn is onclick method in my html.
I also tried:
this[NavigationMixin.GenerateUrl]({
type: 'standard__webPage',
attributes: {
url: '/apex/myVfPage'
}
}).then(generatedUrl => {
console.log("generatedUrl",generatedUrl);
window.open(generatedUrl,'_blank');
});
and :
this[NavigationMixin.Navigate]({
type: 'standard__webPage',
attributes: {
url: '/apex/myVfPage?id=' + this.recordId
}
}).then(generatedUrl => {
window.open(generatedUrl);
});
and also tried to add some to the implelemnt in my aura component - I thought maybe it related.
<aura:component description="descr" implements="flexipage:availableForAllPageTypes,force:hasRecordId,lightning:isUrlAddressable, force:appHostable">
<c:manage recordId="{!v.recordId}" />
</aura:component>
What am I missing here?
Many thanks.