Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <apex:column >
- <apex:facet name="header">Account Name</apex:facet>
- <a href="{!$Site.Prefix}/" id="accID" onclick="openAccPrimaryTab('{!lAAW.accountId}','{!lAAW.accountName}');return false;"><apex:outputText id="rmaName" value="{!lAAW.accountName}"/></a>
- </apex:column>
- var globalAccID = '';
- var recName = '';
- function openAccPrimaryTab(accId,accName) {
- debugger;
- globalAccID = accId;
- recName = accName;
- if (sforce.console.isInConsole()) {
- //First find the ID of the primary tab to put the new subtab in
- sforce.console.getEnclosingPrimaryTabId(openPrimaryTab);
- }
- else {
- window.open('/'+accId,'_blank');
- }
- }
- var openPrimaryTab = function openPrimaryTab(result) {
- //Now that we have the primary tab ID, we can open a new subtab in it
- var rmaurl = document.getElementById("accID").href;
- rmaurl = rmaurl+globalAccID;
- var primaryTabId = result.id;
- sforce.console.openPrimaryTab(null, rmaurl, true, recName, openSuccess, recName)
- };
- var openSuccess = function openSuccess(result) {
- //Report whether opening the new tab was successful
- if (result.success == true) {
- console.log('Primary tab successfully opened');
- } else {
- console.log('Primary tab cannot be opened');
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement