You need to sign in to do that
Don't have an account?
Alex Packard 5
Console API breaks from overridden list page
Create the following visualforce page and name it "TestListPage":
Go to Setup -> Object Manager -> Lead -> Buttons Links and Actions and override the List action with the page you just created.
In lightning experience, go to the Sales Console and select Leads in the navigation menu.
Your new page should appear instead of the normal lead list. Click the "New Tab" button on the page.
A new console tab should open with the same page in it. In the javascript console, you'll notice a success message.
In this list on the left, click the "New Tab" button again. This time, the new tab will not open and you will see the following error message: "Error: Invalid request."
It appears to me that the salesforce console api breaks completely in the list side of the page once a console tab loads integration.js
A member of the Salesforce Technical Support team assured me that if I posted this here that Salesforce's Developer Experts would review my post and create a Known Issue. I look forward to your responses!
<apex:page id="TestListPage" standardController="Lead" recordSetVar="records" > <apex:includeScript value="/support/console/47.0/integration.js"/> <script> function openTab(){ sforce.console.openPrimaryTab(null, '/apex/TestListPage', true, 'PrimaryTab', function(result){ console.log(result); }); } </script> <button onClick="openTab()">New Tab</button> </apex:page>
Go to Setup -> Object Manager -> Lead -> Buttons Links and Actions and override the List action with the page you just created.
In lightning experience, go to the Sales Console and select Leads in the navigation menu.
Your new page should appear instead of the normal lead list. Click the "New Tab" button on the page.
A new console tab should open with the same page in it. In the javascript console, you'll notice a success message.
In this list on the left, click the "New Tab" button again. This time, the new tab will not open and you will see the following error message: "Error: Invalid request."
It appears to me that the salesforce console api breaks completely in the list side of the page once a console tab loads integration.js
A member of the Salesforce Technical Support team assured me that if I posted this here that Salesforce's Developer Experts would review my post and create a Known Issue. I look forward to your responses!
2. This screenshot is after I clicked the "New Tab" button on the left. As you can see, a new tab has been opened with the same page in it. Also, a success message has been printed to the console
3. This screenshot is after I clicked the "New Tab" button on the left a second time. You can see the error message printed in the console.
Let me know what other questions you have. I have seen this problem in multiple orgs, so I am certain I can help you reproduce the issue.
Salesforce, you are bad at addressing instability in your platform
I replicated your mentioned steps and have come up to the same issue you are facing.
I tried googling and found out to be the known issue, please refer - https://success.salesforce.com/issues_view?id=a1p3A0000008k7xQAA&title=sforce-console-openprimarytab-api-not-opening-a-tab-in-new-tab-and-throwing-javascript-error.
It says this been resolved in Winter'18 but we both are still getting the same issue.
Thanks for finding that known issue. It does seem like it may be the same problem or at least something related.
If you're listening, Salesforce, that known issue needs to be reopened or a new one needs to be created.
While I am happy that I finally got them to look into this, it is still very frustrating because I know that this is an issue that I can easily reproduce on everyone's machine in my office! If anybody finds this please help me out and maybe we can get enough info to figure out why Salesforce isn't seeing the problem.