[SalesForce] CONFIRMATIONTOKEN URL Parameter

I am doing a sforce.console.openPrimaryTab() and want to open a Case, in a new console tab, once it has been clicked on. So far I have:

VFP

<apex:pageBlockTable value="{!caseOnCase}" var="item">
    <apex:column headerValue="Merchant Number"><apex:outputLink value="{!URLFOR($Action.Case.View, item.Id)}" onclick="testOpenPrimaryTab(); return false">{!item.Merchant_Number__c}</apex:outputLink></apex:column>

JS

function testOpenPrimaryTab() {
    sforce.console.openPrimaryTab(null, '/' + '{!currentPageId}' + '/d?retURL=https%3Z%2Z%2Zz.cs66.visual.force.com%2Zapex%2ZcasesOnCase%3Qinline%3J9%26id%3H500c065477ytest&_CONFIRMATIONTOKEN=' + '{!CONFIRMATIONTOKEN}' + '&common.udd.actions.ActionsUtilORIG_URI=%2R' + '{!currentPageId}' + '%2test', true, 'salesforce', 'salesforceTab');
}

Everything is working other then the Confirmation Token Part of the URL. {!CONFIRMATIONTOKEN} How would I find the confirmation token and save it into a variable, to be called in this url string?

UPDATE:

On a Case page layout I have an embedded visualforce page. The visualforce page is a list of all related Cases. The apex:column {item.Merchant_Number__c} is a link to the related Case. When I click on the link, I need the related Case to open in a console tab. When I change the apex:column to: <apex:column target="_blank">{!item.Merchant_Number__c}</apex:column> the Case can be opened in a new browser tab. This browser tab's URL is the URL I am trying to use with the sforce.console.openPrimaryTab(). I assume there is some flaw with using the browser URL as my URL for the primary tab function.

CONFIRMATIONTOKEN is just a placeholder for where I need to fill in the confirmation token.

Partial Resolution:
I found the token by doing:

CONFIRMATIONTOKEN = ApexPages.currentPage().getParameters().get('CONFIRMATIONTOKEN');

and passed the token into the string on the VFP. My concern is that this is registering as a duplicate tab. So Salesforce is not allowing me to open it. The error I am getting is: openPrimaryTab: Opening a duplicate tab is not allowed.

Best Answer

Looks like I was way over complicating it. All I needed was the page id. It should look like this:

sforce.console.openPrimaryTab(null, '/' + '{!pageId}', true, 'salesforce', openSuccess, 'salesforceTab');

or

sforce.console.openPrimaryTab(null, '/409b0111009yc7pYTE', true, 'salesforce', openSuccess, 'salesforceTab');
Related Topic