Newer Version Available

This content describes an older version of this product. View Latest

pageReference Types

To navigate in Lightning Experience, Lightning Communities, or the Salesforce mobile app, define a PageReference object. The pageReference type generates a unique URL format and defines attributes that apply to all pages of that type.
The following types are supported.
  • App
  • Lightning Component (must implement lightning:isUrlAddressable)
  • Knowledge Article
  • Login Page
  • Named Page
  • Navigation Item Page
  • Object Page
  • Record Page
  • Record Relationship Page
  • Web Page

PageReference objects are supported on a limited basis for Lightning Communities, as noted for each type.

Note

App Type

A standard or custom app available from the App Launcher in an org. Use this pageReference type to create custom navigation components that take users to a specific app or page within the app. Connected apps aren’t supported.

If you’re navigating users to a different app using a pageRef, the app opens in the same window by default. To open a link in a new tab, see the navigation service documentation.

Note

Type
1standard__app
Experience
Lightning Experience
Type Attributes
Property Type Description Required?
appTarget String

App that you are navigating to. Pass either the appId or appDeveloperName to the appTarget.

The appId is the DurableId field on the AppDefinition sObject.

The appDeveloperName value is formed by concatenating the app’s namespace with the developer name. To find the app’s developer name, navigate to the App Manager in Setup and look in the Developer Name column.

For standard apps, the namespace is standard__. For custom apps it’s c__. For managed packages, it’s the namespace registered for the package.

Yes
pageRef String Identifies a specific location in the app you are navigating to. Pass in the pageRef and applicable attributes for that pageRef type. No
Example Navigating to an App
1{
2    type: "standard__app",
3    attributes: {
4        appTarget: "standard__Sales",
5    }
6}
Example Navigating to a Record in an App
1{
2    type: "standard__app",
3    attributes: {
4        appTarget: "standard__LightningSales",
5        pageRef: {
6            type: "standard__recordPage",
7            attributes: {
8                recordId: "001xx000003DGg0AAG",
9                objectApiName: "Account",
10                actionName: "view"
11            }
12        }
13    }
14}
URL Format
1/lightning/app/{appTarget}{...pageRef}
URL Format Examples

Navigate to the app’s homepage using the appId

1/lightning/app/06mRM0000008dNrYAI

Navigate to an object record’s page in the app using the appId

1/lightning/app/06mRM0000008dNrYAI/o/Case/home

Navigate to the app’s homepage using the appDeveloperName

1/lightning/app/standard__LightningSales

Navigate to an object record’s page in the app using the appDeveloperName

1/lightning/app/standard__LightningSales/o/Case/home

Lightning Component Type

A Lightning component that implements the lightning:isUrlAddressable interface, which enables the component to be navigated directly via URL.

Type
1standard__component
Experience
Lightning Experience, Salesforce Mobile App
Type Attributes
Property Type Description Required?
componentName String The Lightning component name in the format namespace__componentName. Y
Example
1{    
2    "type": "standard__component",
3    "attributes": {
4        "componentName": "c__MyLightningComponent"    
5    },    
6    "state": {
7        "myAttr": "attrValue"    
8    }
9}
URL Format
1/cmp/{componentName}?myAttr=attrValue

Login Page Type

An authentication for a community.

Type
1comm__loginPage
Experience
Lightning Communities
Type Attributes
Property Type Description Required
actionName String A login-related action to be performed. Possible values are:
  • login
  • logout
Yes
Example
1{
2    type: “comm__loginPage”,
3    attributes: {
4        actionName: “login
5    }
6}

Knowledge Article Page Type

A page that interacts with a Knowledge Article record.

Type
1standard__knowledgeArticlePage
Experience
Lightning Experience, Lightning Communities, Salesforce Mobile App
Type Attributes
Property Type Description Required?
articleType String The ArticleType API name of the Knowledge Article record.

In Communities, articleType is ignored.

Y
urlName String The value of the urlName field on the target KnowledgeArticleVersion record. The urlName is the article's URL. Y
Example
1{    
2    "type": "standard__knowledgeArticlePage",
3    "attributes": {
4        "articleType": "Briefings",
5        "urlName": "February-2017"
6    }
7}
URL Format
1/articles/{articleType}/{urlName}
URL Format (Communities)
1/article/{urlName}

Named Page Type

A standard page with a unique name. If an error occurs, the error view loads and the URL isn’t updated. .

Type
1standard__namedPage
1comm__namedPage
Experience
Lightning Experience, Lightning Communities, Salesforce Mobile App
Type Attributes
Property Type Description Required?
pageName String The unique name of the page.
In Lightning Experience and the Salesforce mobile app, possible values are:
  • home
  • chatter
  • today
  • dataAssessment
  • filePreview

In Communities, the value for pageName is the URL value for a supported page. For instance, the default URL value for the Account Management page is /account-management, so the value for pageName would be account-management.

The value of home is reserved for the landing page of any community in your org.

However, because pages in communities are different than pages in Lightning Experience, we’ve moved them to their own namespace for better management and clarity. standard__namedPage is deprecated in communities. Use comm__namedPage instead.

Supported pages in Communities are:
  • Home
  • Account management
  • Contact support
  • Error
  • Login
  • Top Articles
  • Topic Catalog
  • Custom pages
Y
Lightning Experience Example
1{    
2    "type": "standard__namedPage",
3    "attributes": {
4        "pageName": "home"    
5    }
6}
Lightning Communities Example
1{
2    type: "comm__namedPage",
3    attributes: {
4        pageName: "home"
5    }
6}
URL Format
1/page/{pageName}
URL Format (Communities)
1/{pageName}

Navigation Item Page Type

A page that displays the content mapped to a CustomTab. Visualforce tabs, web tabs, Lightning Pages, and Lightning Component tabs are supported.

Type
1standard__navItemPage
Experience
Lightning Experience, Salesforce Mobile App
Type Attributes
Property Type Description Required?
apiName String The unique name of the CustomTab. Y
Example
1{    
2    "type": "standard__navItemPage",
3    "attributes": {
4        "apiName": "MyCustomTabName"    
5    }
6}
URL Format
1/n/{devName}

Object Page Type

A page that interacts with a standard or custom object in the org and supports standard actions for that object.

The standard__objectPage type replaces the force:navigateToObjectHome and the force:navigateToList events.

Note

Type
1standard__objectPage
Experience
Lightning Experience, Lightning Communities, Salesforce Mobile App
Type Attributes
Property Type Description Required?
actionName String The action name to invoke. Valid values include home, list, and new.

In Communities, list and home are the same.

Y
objectApiName String The API name of the standard or custom object. For custom objects that are part of a managed package, prefix the custom object with ns__. Y
Standard Object Example
1{    
2    "type": "standard__objectPage",
3    "attributes": {
4        "objectApiName": "Case",
5        "actionName": "home"
6    }
7}
1{
2    type: "standard__objectPage",
3    attributes: {
4        objectApiName: "Account",
5        actionName: "list"
6    },
7    state: {
8        filterName: "RecentlyViewedAccounts"
9    }
10}
Navigate to a Specific List View Example
1{    
2    "type": "standard__objectPage",
3    "attributes": {
4        "objectApiName": "ns__Widget__c",
5        "actionName": "list"
6    },
7    "state": {
8        "filterName": "RecentlyViewedAccounts"
9  }
10}
URL Format
1/o/{objectApiName}/{actionName}
2/o/{objectApiName}/{actionName}?filterName=Recent
URL Format (Communities)
1/recordlist/{objectApiName}
2/{baseUrl}/{objectApiName}

Record Page Type

A page that interacts with a record in the org and supports standard actions for that record.

The standard__recordPage type replaces the force:navigateToSObject event.

Note

Type
1standard__recordPage
Experience
Lightning Experience, Lightning Communities, Salesforce Mobile App
Type Attributes
Property Type Description Required?
actionName String The action name to invoke. Valid values include clone, edit, and view.

Communities doesn’t support the values clone or edit.

Y
objectApiName String The API name of the record’s object. Optional for lookups.
recordId String The 18 character record ID. Y
Example
1{    
2       "type": "standard__recordPage",
3       "attributes": {
4           "recordId": "001xx000003DGg0AAG",
5           "objectApiName": "PersonAccount",
6           "actionName": "view"
7       }
8}
URL Format
1/r/{objectApiName}/{recordId}/{actionName}
2/r/{recordId}/{actionName}
URL Format (Communities)
1/detail/{recordId}
2/{baseUrl}/{recordId}

Record Relationship Page Type

A page that interacts with a relationship on a particular record in the org. Only related lists are supported.

The standard__recordRelationshipPage type replaces the force:navigateToRelatedList event.

Note

Type
1standard__recordRelationshipPage
Experience
Lightning Experience, Salesforce Mobile App
Type Attributes
Property Type Description Required?
actionName String The action name to invoke. Only view is supported. Y
objectApiName String The API name of the object that defines the relationship. Optional for lookups.
recordId String The 18 character record ID of the record that defines the relationship. Y
relationshipApiName String The API name of the object’s relationship field
Example
1{    
2    "type": "standard__recordRelationshipPage",
3    "attributes": {
4        "recordId": "500xx000000Ykt4AAC",
5        "objectApiName": "Case",
6        "relationshipApiName": "CaseComments",
7        "actionName": "view"
8    }
9}
URL Format
1/r/{objectApiName}/{recordId}/related/{relationshipApiName}/{actionName}
2/r/{recordId}/related/{relationshipApiName}/{actionName}
URL Format (Communities)
1/relatedlist/{recordId}/{relationshipApiName}
2/{baseUrl}/related/{recordId}/{relationshipApiName}

Web Page

An external URL.

The standard__webPage type replaces the force:navigateToURL event.

Note

Type
1standard__webPage
Experience
Lightning Experience, Salesforce Mobile App
Attributes
Property Type Description Required
url String The URL of the page you are navigating to. Yes
Example
1{    
2    "type": "standard__webPage",
3    "attributes": {
4        "url": "http://salesforce.com"
5    }
6}
URL Format
A web page opens as is in a new tab, so it doesn’t have a URL format.