[SalesForce] Type in lightning navigation

In the following code what is passed to type key?

    var pageRef = {
        type: 'custom__recordPage', // What is type here?
        attributes: {
            actionName: 'view',
            objectApiName: 'Inventory__c',
            recordId : resp

Best Answer

It's the value for the page reference type. E.g., if you are navigating to a record page type, then your type value will be standard__recordPage.

A pageReference must be defined with a specific type. The type generates a unique URL format and provides attributes that apply to all pages of that type.

Below are the supported page types as listed in the documentation along with their type values.

  • Lightning Component (type: standard__component)
  • Knowledge Article (type: standard__knowledgeArticlePage)
  • Named Page (type: standard__namedPage)
  • Navigation Item Page (type: standard__navItemPage)
  • Object Page (type: standard__objectPage)
  • Record Page (type: standard__recordPage)
  • Record Relationship Page (type: standard__recordRelationshipPage)