I have below aura component added on the account record page from the app builder
HTML:
<aura:component implements="flexipage:availableForAllPageTypes">
<lightning:workspaceAPI aura:id="workspace" />
<lightning:button label="Open Tab" onclick="{! c.openTab }" />
</aura:component>
JS:
openTab: function (component, event, helper) {
const workspaceAPI = component.find("workspace");
workspaceAPI.openTab({
url: '/apex/my_vf_page',
focus: true
}).then(function (response) {
workspaceAPI.getTabInfo({
tabId: response
}).then(function (tabInfo) {
console.log("The recordId for this tab is: " + tabInfo.recordId);
});
}).catch(function (error) {
console.log(error);
});
}
but it logs below error on the console log
Error: API
openTab
is not currently supported in this application.
Could someone please help me what am I doing wrong?