Is there any way to load the page of the current URL? I have tried the below code. It redirects to the URL, but, keeps loading the page and doesn't show any result.

import { LightningElement, api } from 'lwc';

import LCP_ICONS from '@salesforce/resourceUrl/lcp_icons';

export default class LcpLicenceDetailSection extends LightningElement {

get associatedLicenceDetails() {

        for (let licence of this.detailsObj.associatedLicences) {

            let url = new URL(window.location.href);
            let searchParams = url.searchParams;
            searchParams.set('licenceNumber', licence.licenceNumber);
            licence.detailsLink = url;
        return this.sortArrayByText(this.detailsObj.associatedLicences, 'name');

I am not sure about your exact issue, but just in case make sure you import the below directory if you are trying to use any navigation from LWC

import {
} from 'lightning/navigation';

Also extends the class NavigationMixin

export default class LcpLicenceDetailSection extends NavigationMixin(LightningElement)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.