0

Lightning Console allows Admins to configure if a record should be opened as a (Primary/Workspace) Tab or a Subtab via Navigation Rules

Is there a way to find out programmatically if my record should be opened as Tab or SubTab?

Looking at the workspaceAPI documentation, I did not find any immediate solution.

1 Answer 1

0

I did check User Interface API if there is any information for such settings and apparently it's not exposed. Example response from standard Service Console app:

{
  "appId" : "06m1r000000vb4pAAA",
  "description" : "(Lightning Experience) Lets support agents work with multiple records across customer service channels on one screen",
  "developerName" : "LightningService",
  "eTag" : "a5305caf337b368c995db109e843e878",
  "formFactors" : [ "Small", "Large" ],
  "headerColor" : "#802ABE",
  "iconUrl" : "https://xxxx.my.salesforce.com/logos/Salesforce/LightningService/icon.png",
  "isNavAutoTempTabsDisabled" : false,
  "isNavPersonalizationDisabled" : false,
  "label" : "Service Console",
  "logoUrl" : "https://xxxx.my.salesforce.com/logos/Salesforce/LightningService/logo.png",
  "mobileStartUrl" : null,
  "navItems" : [ {
    "availableInClassic" : true,
    "availableInLightning" : true,
    "color" : "F2CF5B",
    "content" : "https://xxxx.my.salesforce.com/500/o",
    "custom" : false,
    "developerName" : "standard-Case",
    "iconUrl" : "https://xxxx.my.salesforce.com/img/icon/t4v35/standard/case_120.png",
    "id" : null,
    "itemType" : "Entity",
    "label" : "Cases",
    "objectApiName" : "Case",
    "objectLabel" : "Case",
    "objectLabelPlural" : "Cases",
    "pageReference" : {
      "attributes" : {
        "objectApiName" : "Case",
        "actionName" : "home"
      },
      "state" : { },
      "type" : "standard__objectPage"
    },
    "standardType" : null
  }, {
    "availableInClassic" : true,
    "availableInLightning" : true,
    "color" : "A094ED",
    "content" : "https://xxxx.my.salesforce.com/003/o",
    "custom" : false,
    "developerName" : "standard-Contact",
    "iconUrl" : "https://xxxx.my.salesforce.com/img/icon/t4v35/standard/contact_120.png",
    "id" : null,
    "itemType" : "Entity",
    "label" : "Contacts",
    "objectApiName" : "Contact",
    "objectLabel" : "Contact",
    "objectLabelPlural" : "Contacts",
    "pageReference" : {
      "attributes" : {
        "objectApiName" : "Contact",
        "actionName" : "home"
      },
      "state" : { },
      "type" : "standard__objectPage"
    },
    "standardType" : null
  }, {
    "availableInClassic" : true,
    "availableInLightning" : true,
    "color" : "7F8DE1",
    "content" : "https://xxxx.my.salesforce.com/001/o",
    "custom" : false,
    "developerName" : "standard-Account",
    "iconUrl" : "https://xxxx.my.salesforce.com/img/icon/t4v35/standard/account_120.png",
    "id" : null,
    "itemType" : "Entity",
    "label" : "Accounts",
    "objectApiName" : "Account",
    "objectLabel" : "Account",
    "objectLabelPlural" : "Accounts",
    "pageReference" : {
      "attributes" : {
        "objectApiName" : "Account",
        "actionName" : "home"
      },
      "state" : { },
      "type" : "standard__objectPage"
    },
    "standardType" : null
  }, {
    "availableInClassic" : true,
    "availableInLightning" : true,
    "color" : "2ECBBE",
    "content" : "https://xxxx.my.salesforce.com/00O/o",
    "custom" : false,
    "developerName" : "standard-report",
    "iconUrl" : "https://xxxx.my.salesforce.com/img/icon/t4v35/standard/report_120.png",
    "id" : null,
    "itemType" : "Standard",
    "label" : "Reports",
    "objectApiName" : "Report",
    "objectLabel" : "Report",
    "objectLabelPlural" : "Reports",
    "pageReference" : {
      "attributes" : {
        "objectApiName" : "Report",
        "actionName" : "home"
      },
      "state" : { },
      "type" : "standard__objectPage"
    },
    "standardType" : "Reports"
  }, {
    "availableInClassic" : true,
    "availableInLightning" : true,
    "color" : "EF6E64",
    "content" : "https://xxxx.my.salesforce.com/01Z/o",
    "custom" : false,
    "developerName" : "standard-Dashboard",
    "iconUrl" : "https://xxxx.my.salesforce.com/img/icon/t4v35/standard/dashboard_120.png",
    "id" : null,
    "itemType" : "Standard",
    "label" : "Dashboards",
    "objectApiName" : "Dashboard",
    "objectLabel" : "Dashboard",
    "objectLabelPlural" : "Dashboards",
    "pageReference" : {
      "attributes" : {
        "objectApiName" : "Dashboard",
        "actionName" : "home"
      },
      "state" : { },
      "type" : "standard__objectPage"
    },
    "standardType" : "Dashboards"
  }, {
    "availableInClassic" : false,
    "availableInLightning" : true,
    "color" : "489DD0",
    "content" : null,
    "custom" : false,
    "developerName" : "standard-Feed",
    "iconUrl" : "https://xxxx.my.salesforce.com/img/icon/t4v35/standard/feed_120.png",
    "id" : null,
    "itemType" : "Standard",
    "label" : "Chatter",
    "objectApiName" : "Feed",
    "objectLabel" : null,
    "objectLabelPlural" : null,
    "pageReference" : {
      "attributes" : {
        "pageName" : "chatter"
      },
      "state" : { },
      "type" : "standard__namedPage"
    },
    "standardType" : "Feed"
  }, {
    "availableInClassic" : true,
    "availableInLightning" : true,
    "color" : "EF7EAD",
    "content" : "https://xxxx.my.salesforce.com/lightning/page/home",
    "custom" : false,
    "developerName" : "standard-home",
    "iconUrl" : "https://xxxx.my.salesforce.com/img/icon/t4v35/standard/home_120.png",
    "id" : null,
    "itemType" : "Standard",
    "label" : "Home",
    "objectApiName" : "Home",
    "objectLabel" : null,
    "objectLabelPlural" : null,
    "pageReference" : {
      "attributes" : {
        "pageName" : "home"
      },
      "state" : { },
      "type" : "standard__namedPage"
    },
    "standardType" : "Home"
  }, {
    "availableInClassic" : true,
    "availableInLightning" : true,
    "color" : "679ef0",
    "content" : "https://xxxx.my.salesforce.com/a01/o",
    "custom" : true,
    "developerName" : "Error__c",
    "iconUrl" : "https://xxxx.my.salesforce.com/img/icon/t4v35/custom/custom73_120.png",
    "id" : null,
    "itemType" : "Entity",
    "label" : "Errors",
    "objectApiName" : "Error__c",
    "objectLabel" : "Error",
    "objectLabelPlural" : "Errors",
    "pageReference" : {
      "attributes" : {
        "objectApiName" : "Error__c",
        "actionName" : "home"
      },
      "state" : { },
      "type" : "standard__objectPage"
    },
    "standardType" : null
  }, {
    "availableInClassic" : true,
    "availableInLightning" : true,
    "color" : "38c393",
    "content" : "https://xxxx.my.salesforce.com/a00/o",
    "custom" : true,
    "developerName" : "Tree__c",
    "iconUrl" : "https://xxxx.my.salesforce.com/img/icon/t4v35/custom/custom32_120.png",
    "id" : null,
    "itemType" : "Entity",
    "label" : "Trees",
    "objectApiName" : "Tree__c",
    "objectLabel" : "Tree",
    "objectLabelPlural" : "Trees",
    "pageReference" : {
      "attributes" : {
        "objectApiName" : "Tree__c",
        "actionName" : "home"
      },
      "state" : { },
      "type" : "standard__objectPage"
    },
    "standardType" : null
  }, {
    "availableInClassic" : true,
    "availableInLightning" : true,
    "color" : "6b9ee2",
    "content" : "https://xxxx.my.salesforce.com/a02/o",
    "custom" : true,
    "developerName" : "Error_Tree__c",
    "iconUrl" : "https://xxxx.my.salesforce.com/img/icon/t4v35/custom/custom9_120.png",
    "id" : null,
    "itemType" : "Entity",
    "label" : "Error Trees",
    "objectApiName" : "Error_Tree__c",
    "objectLabel" : "Error Tree",
    "objectLabelPlural" : "Error Trees",
    "pageReference" : {
      "attributes" : {
        "objectApiName" : "Error_Tree__c",
        "actionName" : "home"
      },
      "state" : { },
      "type" : "standard__objectPage"
    },
    "standardType" : null
  } ],
  "selected" : true,
  "startUrl" : "https://xxxx.my.salesforce.com/home/home.jsp?tsid=02u1r000000vb4p",
  "type" : "Lightning",
  "userNavItems" : [ ]
}

You can look at Cases or Contacts as an example of Objects opened as subtabs. Unfortunately there isn't any info about that.

As workspace API also does not store such info I think it's not possible to get it from anywhere currently.

To be honest I do not have any idea for workaround besides the fact that you can create custom metadata which will be filled with exact same settings as Admins set. So duplicated places which is not such a great idea.

API Resource

1

You must log in to answer this question.

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