You need to sign in to do that
Don't have an account?
Open link in subtab in Lightning Console
Hello Trailblazers,
When a user clicks on the link, it should open in a subtab in lightning console. Below is the VF page that I have come up with, however it's not working as expected. Any inputs will be highly appreciated.
Thank you
Shravan
When a user clicks on the link, it should open in a subtab in lightning console. Below is the VF page that I have come up with, however it's not working as expected. Any inputs will be highly appreciated.
<apex:page standardController="LiveChatTranscript" extensions="PastChatSearchController"> <apex:includeScript value="/support/console/45.0/integration.js"/> <script> var preRecordId; function openSubtab(id, name) { preRecordId= id; alert('URL----->'+'{!$CurrentPage.URL}'); if (sforce.console.isInConsole()) sforce.console.getEnclosingPrimaryTabId(openSubtab); else window.top.location.href = '/' + id; } var openSubtab = function openSubtab(result) { var primaryTabId = result.id; sforce.console.openSubtab(primaryTabId, '/'+preRecordId, true, preRecordId , null , openSuccess, 'salesforceSubtab'); }; </script> <apex:form > <apex:pageBlock id="pb"> <apex:pageMessages ></apex:pageMessages> <apex:pageBlockTable value="{!LiveChatTranscript}" var="d"> <apex:column headerValue="Live Chat Transcript Name"> <!-- <apex:outputLink target="_blank" style="color:blue" value="{!URLFOR($Action.LiveChatTranscript.View, d.ID)}"> {!d.Name} </apex:outputLink> --> <a href="#" onclick="openSubtab('{!d.id}', '{!d.id}');return false">{!d.Name}</a> </apex:column> <apex:column headerValue="CreatedDate"> <apex:outputField value="{!d.CreatedDate}"> </apex:outputField> </apex:column> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:page>
Thank you
Shravan
Greetings to you!
Please refer to the below links which might help you further with the above requirement.
https://salesforce.stackexchange.com/questions/195801/open-link-as-subtab-in-console-view-and-a-new-browser-tab-otherwise
https://developer.salesforce.com/forums#!/feedtype=SINGLE_QUESTION_SEARCH_RESULT&id=906F0000000BTpTIAW
https://developer.salesforce.com/forums/?id=9060G000000XfF8QAK
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
Please refer this code
https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/sforce_api_console_lightning_openSubtab.htm