We are currently trying to replace an existing working code with another "future proof" one.

Basically we have a stand alone app that's invoked whenever a user clicks on a button within a lightning component.

A new window is open and the stand alone app loads just fine.

Here is the snapshot of the code opening the app:

var urlEvent = $A.get("e.force:navigateToURL");
   "url": '/c/myApp.app?recId=' + component.get('v.recordId') + 
          '&Rows=' + component.get('v.Rows') + '&Bytes=' + 

The app (called myApp) is invoked and we have a couple variables been passed to it.

We tried using the new lightning:navigation component, but it didn't work.

The goal was to try building a pageReference instead or parsing/creating a URL directly. Which could help us by avoiding broken navigation if Salesforce changes the URL format in the future.

The first problem we encountered was, the availabe pageReference Types (which is required) are:

• Lightning Component (must implement lightning:isUrlAddressable) • Knowledge Article • Named Page • Navigation Item Page • Object Page • Record Page • Record Relationship Page

There was no reference to an App.

The documentation states: "These navigation resources are supported only in Lightning Experience and the Salesforce mobile app. They’re not supported in other containers, such as Lightning Components for Visualforce, Lightning Out, or Communities. This is true even if you access these containers inside Lightning Experience or the Salesforce mobile app."

Since the app is running on his own (not within the Lightning Experience or Salesforce1), am I correct to say that our current solution is the only possible way of doing it?

If not, what would be other approach so we don't need to worry future URL changes on Salesforce side?


1 Answer 1


Going through Spring 19 release notes I stumbled upon this:


Navigate to a Web Page

The navigation service supports different kinds of pages in Lightning. Each page reference type supports a different set of attributes and state properties. Instead of using force:navigateToURL, we recommend navigating to web pages using the lightning:navigate component with the standard__webPage page type.

This code shows examples of navigating to a web page using the old force:navigateToURL event.

// Old way to navigate to a web page
    url: 'http://salesforce.com',

Replace the previous code that uses force:navigateToURL with the following code.

This example shows how to navigate to a web page using the standard__webPage page type. It assumes that you added in your component markup.

    type: "standard__webPage",
    attributes: {
       url: 'http://salesforce.com'

THAT's exactly what I was looking for but isn't available in Prod yet :), just in SB with Spring 19!!!!

You must log in to answer this question.

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