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.
Use the PageReference
object with the NavigationMixin
function from the lightning/navigation
module. For information about using a PageReference to navigate, see Navigate to Different Page Types.
These page reference types are supported.
- App
- External Record Page
- External Record Relationship Page
- Knowledge Article
- Lightning Component
- Login Page
- Managed Content Page (Salesforce CMS)
- Named Page (Experience Builder sites)
- Named Page (Standard)
- Navigation Item Page
- Object Page
- Record Page
- Record Relationship Page
- Web Page
PageReference
objects are supported on a limited basis for Experience Builder sites, as noted for each type. They aren’t supported in Lightning Out.
Navigating using the PageReference
objects supersedes the legacy way of using an Aura event to navigate. For example, navigate to web pages using the lightning/navigation
module with the standard__webPage
page type instead of using force:navigateToURL
. See Migrate Events.
A standard or custom app available from the App Launcher in an org. Use this type to create custom navigation components that take users to a specific app or to a page within an 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.
Lightning Experience
Property | Type | Description | Retired? |
---|---|---|---|
appTarget | String | App that you're navigating to. Pass either the appId or appDeveloperName to the appTarget .
standard__ . For custom apps, it's c__ . For managed packages, it's the namespace registered for the package. | Yes |
pageRef | PageREference | Identifies a specific location in the app you're navigating to. Pass in the pageRef and applicable attributes for that pageRef type. | No |
Navigate to the app’s homepage using the appId
Navigate to an object record’s page in the app using the appId
Navigate to the app’s homepage using the appDeveloperName
Navigate to an object record’s page in the app using the appDeveloperName
A page that interacts with an external record. Currently supports CMS Connect pages.
Experience Builder Aura Sites
Property | Type | Description | Required? |
---|---|---|---|
recordId | String | External record ID. | Yes |
objectType | String | External record type. Currently only supports cms for CMS Connect. | Yes |
objectInfo | Object | Additional information used to identify the record for the objectType . | Yes |
A page that interacts with an external relationship on a particular record in the org. Currently only supports Quip Related List page.
Experience Builder Aura Sites
Property | Type | Description | Required? |
---|---|---|---|
recordId | String | The 18 character record ID. | Yes |
objectType | String | External record type. Currently only supports quip for Quip docs. | Yes |
A Lightning web component or Aura component. To make an addressable Lightning web component, use the lightning__isUrlAddressable
target with the lightning__AppPage
target. The lightning__AppPage
target enables the component to be used on an app page, which is displayed when you navigate to /lightning/cmp/c__componentName
.
Lightning Experience, Salesforce Mobile App
Property | Type | Description | Required |
---|---|---|---|
componentName | String | The Lightning component name in the format namespace__componentName . | Yes |
You can pass any key and value in the state
object. The key must include a namespace, and the value must be a string. When you include the state
like in the example, the URL format is /lightning/cmp/c__MyComponent?c__counter=5
. The component name is case-sensitive. For more information, see Navigate to a URL-Addressable Component.
A page that interacts with a Knowledge Article record.
Lightning Experience, Experience Builder sites, Salesforce Mobile App
Property | Type | Description | Required |
---|---|---|---|
articleType | String | The articleType API name of the Knowledge Article record.In Experience Builder sites, articleType is ignored. | Yes |
urlName | String | The value of the urlName field on the target KnowledgeArticleVersion record. The urlName is the article's URL. | Yes |
A page for authentication into an Experience Builder site.
Experience Builder sites
Property | Type | Description | Required |
---|---|---|---|
actionName | String | A login-related action to be performed. Possible values are:
| Yes |
A CMS content page in an Experience Builder site with a unique name.
Experience Builder sites
Property | Type | Description | Required |
---|---|---|---|
contentTypeName | String | The name of the Salesforce CMS content type. | Yes |
contentKey | String | The unique content key that identifies CMS content. | Yes |
A standard page used in Experience Builder sites with a unique name. If an error occurs, the error view loads and the URL isn’t updated.
Experience Builder sites
Property | Type | Description | Required |
---|---|---|---|
name | String | The unique name of the Experience Builder 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 in Experience Builder sites are:
| Yes |
A standard page with a unique name. If an error occurs, the error view loads and the URL isn’t updated.
Lightning Experience, Salesforce Mobile App
Property | Type | Description | Required |
---|---|---|---|
pageName | String | The unique name of the page. Possible values are:
| Yes |
A page that displays the content mapped to a custom tab. Visualforce tabs, web tabs, Lightning Pages, and Lightning Component tabs are supported.
Lightning Experience, Salesforce Mobile App
Property | Type | Description | Required |
---|---|---|---|
apiName | String | The unique name of the custom tab. | Yes |
For an example, see Navigate to Different Page Types.
A page that interacts with a standard or custom object in the org and supports standard actions for that object.
Lightning Experience, Experience Builder sites, Salesforce Mobile App
Property | Type | Description | Required |
---|---|---|---|
actionName | String | The action name to invoke. Valid values include home , list , and new .In Experience Builder sites, list and home are the same. | Yes |
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__ . | Yes |
Property | Type | Description | Required? |
---|---|---|---|
filterName | String | ID or developer name of the object page. Default is Recent . Supported actions are: list . | No |
defaultFieldValues | String | List of key-value pairs for the default field values that you’re passing. This list is generated by the lightning/pageReferenceUtils module. Supported actions are: new . | No |
nooverride | String | To use a standard action, assign this property any value, such as 1 . To use an override action, don’t include this property at all. Supported actions are: home , list , new . | No |
For an example, see Navigate to Different Page Types.
A page that interacts with a record in the org and supports standard actions for that record.
Lightning Experience, Experience Builder sites, Salesforce Mobile App
Property | Type | Description | Required |
---|---|---|---|
actionName | String | The action name to invoke. Valid values include clone , edit , and view .Experience Builder sites don’t support the values clone or edit . | Yes |
objectApiName | String | The API name of the record’s object. Optional for lookups. |
|
recordId | String | The 18 character record ID. | Yes |
- State
Property | Type | Description | Required? |
---|---|---|---|
nooverride | String | To 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 |
For an example, see Navigate to Different Page Types.
A page that interacts with a relationship on a particular record in the org. Only related lists are supported.
Lightning Experience, Experience Builder sites, Salesforce Mobile App
Property | Type | Description | Required |
---|---|---|---|
actionName | String | The action name to invoke. Only view is supported. | Yes |
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. | Yes |
relationshipApiName | String | The API name of the object’s relationship field. | Yes |
For an example, see Navigate to Different Page Types.
An external URL.
If you use your Lightning web component in an Aura-based Experience Builder site, note that certain 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 the force:navigateToURL
Aura event. Use window.open
if you want to go straight to the URL, such as opening /apex/
directly in a new tab.
Lightning Experience, Experience Builder sites, Salesforce Mobile App
Property | Type | Description | Required |
---|---|---|---|
url | String | The URL of the page you’re navigating to. | Yes |
For an example, see Navigate to Different Page Types.
See Also
- Navigate to Pages, Records, and Lists
- Open Files
- Lightning Web Component Library: lightning-navigation
- LWR Sites for Experience Cloud: Lightning Navigation