pageReference Types

To navigate in Lightning Experience, Experience Builder sites, 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. For Experience Builder sites, depending on the page type, the pageReference property requirements can differ between LWR sites and Aura sites.

The following types are supported.

  • App
  • External Record Page
  • External Record Relationship Page
  • Knowledge Article
  • Lightning Component (must implement lightning:isUrlAddressable)
  • Login Page
  • Managed Content Page (Salesforce CMS)
  • Named Page (Experience Cloud)
  • Named Page (Standard)
  • Navigation Item Page
  • Object Page
  • Record Page
  • Record Relationship Page
  • Standard Flow
  • Web Page

PageReference objects are supported on a limited basis for Experience Builder sites, 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

PropertyTypeDescriptionRequired?
appTargetStringApp that you’re 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
pageRefPageReferenceIdentifies a specific location in the app you’re 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

External Record Page 

A page that interacts with an external record. Currently supports CMS Connect pages.

Type

1comm__externalRecordPage;

Experience: Experience Builder Aura Sites

Type Attributes

PropertyTypeDescriptionRequired?
recordIdStringExternal record ID. 
objectTypeStringExternal record type. Currently only supports cms for CMS Connect. 
objectInfoObjectAdditional information used to identify the record for the objectType. 

Example

1{
2    type: "comm__externalRecordPage",
3    attributes: {
4        recordId: "26",
5        objectType: "cms",
6        objectInfo: {
7            cmsSourceName: "blog",
8            cmsTypeName: "feed",
9        }
10    },
11    state: {
12        recordName: "coffee-on-the-world-map",
13    }
14}

URL Format

1/{baseUrl}/{recordId}/{recordName}

External Record Relationship Page 

A page that interacts with an external relationship on a particular record in the org. Currently only supports Quip Related List page.

Type

1comm__externalRecordRelationshipPage;

Experience: Experience Builder Aura Sites

Type Attributes

PropertyTypeDescriptionRequired?
recordIdStringThe 18 character record ID. 
objectTypeStringExternal record type. Currently only supports quip for Quip docs. 

Example

1{
2    type: "comm__externalRecordRelationshipPage",
3    attributes: {
4        recordId: "001xx000003DGg0AAG",
5        objectType: "quip",

URL Format

1/{baseUrl}/{recordId}

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

PropertyTypeDescriptionRequired?
componentNameStringThe Lightning component name in the format namespace__componentName.Yes

Example

1{
2    "type": "standard__component",
3    "attributes": {
4        "componentName": "c__MyLightningComponent"
5    },
6    "state": {
7        "c__myAttr": "attrValue"
8    }
9}

You can pass any key and value in the state object. The key must include a namespace, and the value must be a string. If you don’t have a registered namespace, add the default namespace of c__.

URL Format

1/cmp/{componentName}?c__myAttr=attrValue

Login Page Type 

An authentication for an Experience Builder site.

Type

1comm__loginPage;

Experience: Experience Builder sites

Type Attributes

PropertyTypeDescriptionRequired
actionNameStringA login-related action to be performed. Possible values are login or logout.Yes

You can only navigate to comm__namedPages when you’re calling navigate from: Login, Check Password, Forgot Password, Login Error, and Register. Other page references don’t work from these pages.

Note

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, Experience Builder sites, Salesforce Mobile App

Type Attributes

PropertyTypeDescriptionRequired?
articleTypeStringThe ArticleType API name of the Knowledge Article record. In Experience Builder sites, articleType is ignored.Yes
urlNameStringThe value of the urlName field on the target KnowledgeArticleVersion record. The urlName is the article’s URL.Yes

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 (Experience Cloud)

1/article/{urlName}

Managed Content Page (Salesforce CMS) 

A CMS content page in an Experience Builder site with a unique name.

Type

1standard__managedContentPage;

Experience: Experience Builder sites

Type Attributes

PropertyTypeDescriptionRequired?
contentTypeNameStringThe name of the Salesforce CMS content type.Yes
contentKey The unique content key that identifies CMS content.Yes

Example

1{
2    type: 'standard__managedContentPage',
3    attributes : {
4        'contentTypeName': 'news',
5        'contentKey': 'MCOMALJDRAYFFSFPNBQONYXVFHOA'
6    }
7}

URL Format

1/:urlAlias

Named Page Type (Experience Cloud) 

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

Type

1comm__namedPage;

Experience:

: Experience Builder sites

Type Attributes

PropertyTypeDescriptionRequired?
nameStringThe unique name of the Experience Builder site page. The value for name is the API Name value for a supported page. The API Name field can only be defined when a new page is being created, and must be unique. If the API Name isn’t defined upon page creation, it’s automatically generated. The value of home is reserved for the landing page of any Experience Builder site in your org. Supported pages are Home, Account Management, Contact Support, Error, Login, My Account, Top Articles, Topic Catalog, and custom pages.Yes

Example

1{
2    type: "comm__namedPage",
3    attributes: {
4        name: "Home"
5    }
6}

URL Format

1/{URL as defined on the page’s properties}

Named Page Type (Standard) 

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

Type

1standard__namedPage;

Experience: Lightning Experience, Salesforce Mobile App

Type Attributes

PropertyTypeDescriptionRequired?
pageNameStringThe unique name of the page. Possible values are home, chatter, today, dataAssessment, or filePreview.Yes

Example

1{
2    "type": "standard__namedPage",
3    "attributes": {
4        "pageName": "home"
5    }
6}

URL Format

1/page/{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

PropertyTypeDescriptionRequired?
apiNameStringThe unique name of the CustomTab.Yes

Example

1{
2    "type": "standard__navItemPage",
3    "attributes": {
4        "apiName": "MyCustomTabName"
5    }
6}

URL Format

1/n/{apiName}

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, Experience Builder sites, Salesforce Mobile App

Type Attributes

PropertyTypeDescriptionRequired?
actionNameStringThe action name to invoke. Valid values include home, list, and new. In Experience Builder sites, list and home are the same.Yes
objectApiNameStringThe API name of the standard or custom object. For custom objects that are part of a managed package, prefix the custom object with ns__.Yes

State

PropertyTypeDescriptionSupported ActionsRequired?
filterNameStringID or developer name of the object page. Default is Recent.listNo
defaultFieldValuesStringList of key-value pairs for the default field values that you’re passing. This list is generated by the lightning:pageReferenceUtils component. See lightning:pageReferenceUtils for details.newNo
nooverrideStringTo use a standard action, assign this property any value, such as 1. To use an override action, don’t include this property at all.home, list, newNo

Standard Object Example

1// Opens the case home page.
2{
3    "type": "standard__objectPage",
4    "attributes": {
5        "objectApiName": "Case",
6        "actionName": "home"
7    }
8}

Navigate to a Specific List View Example

1// Navigates to account list with the filter set to RecentlyViewedAccounts.
2{
3    "type": "standard__objectPage",
4    "attributes": {
5        "objectApiName": "ns__Widget__c",
6        "actionName": "list"
7    },
8    "state": {
9        "filterName": "RecentlyViewedAccounts"
10  }
11}

Navigate to a Record Create Page with Default Field Values

1// Navigates to a new account object using these default field values.
2//{
3//    Name: "Salesforce, #1=CRM",
4//    OwnerId: "005XXXXXXXXXXXXXXX",
5//    AccountNumber: "ACXXXX",
6//    NumberOfEmployees: 35000,
7//    CustomCheckbox__c: true
8//}
9{
10    type: "standard__objectPage",
11    attributes: {
12        objectApiName: "Account",
13        actionName: "new"
14    },
15    state: {
16        defaultFieldValues = "AccountNumber=ACXXXX,CustomCheckbox__c=true,Name=Salesforce%2C%20%231%3DCRM,NumberOfEmployees=35000,OwnerId=005XXXXXXXXXXXXXXX",
17        nooverride: "1"
18    }
19}

URL Format

1/o/{objectApiName}/{actionName} /o/{objectApiName}/{actionName}?filterName=Recent

URL Format (Experience Cloud)

1/recordlist/{objectApiName} /{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, Experience Builder sites, Salesforce Mobile App

Type Attributes

PropertyTypeDescriptionRequired?
actionNameStringThe action name to invoke. Valid values include clone, edit, and view. Experience Builder sites don’t support the values clone or edit.Yes
objectApiNameStringThe API name of the record’s object. Optional for lookups.Yes, for Experience Builder LWR sites only No, for all other experiences
recordIdStringThe 18 character record ID.Yes

State

PropertyTypeDescriptionRequired?
nooverrideStringTo use a standard action, assign this property any value, such as 1. To use an override action, don’t include this property at all.No

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} /r/{recordId}/{actionName}

URL Format (Experience Cloud)

1/detail/{recordId} /{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, Experience Builder sites, Salesforce Mobile App

Type Attributes

PropertyTypeDescriptionRequired?
actionNameStringThe action name to invoke. Only view is supported.Yes
objectApiNameStringThe API name of the object that defines the relationship. Optional for lookups.Yes, for Experience Builder LWR sites only No, for all other experiences
recordIdStringThe 18 character record ID of the record that defines the relationship.Yes
relationshipApiNameStringThe API name of the object’s relationship field.Yes

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 (Experience Cloud)

1/relatedlist/{recordId}/{relationshipApiName} /{baseUrl}/related/{recordId}/{relationshipApiName}

Standard Flow Type 

A page that runs an active screen or autolaunched flow.

Type

1standard__flow;

Experience: Lightning Experience

Type Attributes

PropertyTypeDescriptionRequired?
devNameStringThe flow name (flowNameor namespace__flowName).Yes
retURLStringThe relative URL to redirect users to when the flow finishes.No

Example

You can pass input variable values to the flow in the state object. The key must be prefixed by flow__. Record variables, Apex-Defined variables, and collection variables are not supported.

1{
2  "type": "standard__flow",
3  "attributes": {
4    "devName": "MyFlow"
5  },
6  "state": {
7    "flow__myInputVar": "inputVarValue"
8    "retURL" : "lightning/page/home"
9  }
10}

URL Format

1/lightning/flow/{flowName}?flow__myInputVar=inputVarValue&retUrl=lightning%2Fpage%2Fhome

Web Page 

An external URL. Navigate to web pages using the lightning:navigate component with the standard__webPage page type instead of using force:navigateToURL. In Aura sites, certain internal Salesforce URLs have site-specific processing. For example, /apex/ URLs are translated to /sfdcpage/. The Visualforce page is embedded within the site in an iFrame, which is the same behavior as with force:navigateToURL. Use window.open if you want to go straight to the URL, such as opening /apex/ directly in a new tab.

On orgs running API version 68 or later with Lightning Web Security for Aura enabled, opening a same-origin Salesforce URL in a new tab using window.open() with _blank results in a LockerSecurityError.

Important

For same-origin downloads and navigation, use this programmatic anchor click.

1const a = document.createElement('a');
2a.href = url;                   // /apex/... clears the href denylist
3a.target = '_blank';            // or omit for same-tab
4a.rel = 'noopener noreferrer';
5a.click();                     // keep it detached; do NOT append to body/head

Type

1standard__webPage;

Experience: Lightning Experience, Salesforce Mobile App

Attributes

PropertyTypeDescriptionRequired
urlStringThe URL of the page you’re navigating to.Yes

Example

1{
2    "type": "standard__webPage",
3    "attributes": {
4        "url": "https://salesforce.com"
5    }
6}

URL Format: A web page opens as is in a new tab, so it doesn’t have a URL format.

See Also