Skip to main content

I read that navigationMixin of pageReference type standard__webPage is supported in LWC quick actions for FS Mobile, but when I try to open a link, it errors.

I would appreciate any help!

NavigationMixin - standard_webPage not working in LWC in FS mobile appMy code is the following:

let openFileUrl = 'https://example.com/library/My Documents/MyPage.aspx?id=%2FMy%20Documents%2F0WO01000001jrM3GAI/IMG_0111.jpeg"';

this[NavigationMixin.Navigate]({

type: "standard__webPage",

attributes: {

url: openFileUrl

}

});

1 answer
  1. Nov 30, 2023, 5:32 AM

    Hi @Rei Suzuki

    Hope you are doing well

    The standard__webPage type in NavigationMixin should indeed work for opening web pages in Salesforce Mobile. However, there might be issues with the URL format or the structure of your code causing errors.

    Here's an example of how you should structure the code:

    .....................................................................................................

    import { LightningElement } from 'lwc';

    import { NavigationMixin } from 'lightning/navigation';

     

    export default class YourComponent extends NavigationMixin(LightningElement) {

        openFileUrl = 'https://example.com/library/My Documents/MyPage.aspx?id=%2FMy%20Documents%2F0WO01000001jrM3GAI/IMG_0111.jpeg';

     

        navigateToURL() {

            this[NavigationMixin.Navigate]({

                type: 'standard__webPage',

                attributes: {

                    url: this.openFileUrl

                }

            });

        }

    }

    ..............................................................................................................................................

    A few things to consider:

    1. Ensure that your URL is properly encoded. It seems like the URL you provided might have an issue with the encoding (e.g., spaces should be replaced with %20). Ensure that special characters are appropriately URL encoded.
    2. Check the permissions and settings within Salesforce Mobile. Sometimes, if the URL is considered unsafe or blocked, it might cause an error.
    3. Verify that the code structure and import statements are correct in your Lightning Web Component (LWC). Ensure that the component is correctly wired up to the button or action that triggers this navigation.
    1.  
    1. Hope you will understand your issue with this content.
    1. Thanks!
    1. #FSL Mobile #Service Cloud 
0/9000