1

I have created a custom Visualforce page for a New Case creation. If I don't set the SubTab Label it displays 'External Page' and when I save my Case the standard Case page shows the Case icon and Case number correctly on the tab.

If I set the SubTab label to be something like 'New Case' the label will persist on the standard Case page for the saved Case.

// Set the Tab Label
var tabLabel = "New Case"; 
sforce.console.getFocusedSubtabId(function(result){
    sforce.console.setTabTitle(tabLabel, result.id);
});

How can I reset the label after saving the Case so the Standard Case display page will show the Case icon and Case number?

1

I have a similar circumstance.

A little background: I have a Visualforce Page in the Case layout that looks like a linked field. When the link is clicked, I change the primary tab content and title through the Salesforce Console Integration Toolkit.

Anyway, though it is more convenient for me because I already have this functionality in my layout, you can merge a Visualforce Page into the Page Layout and use the toolkit from there. If you set its height to 18px it looks just like a blank space or field as you desire.

<apex:page standardController="{!Case}" showHeader="false" standardStylesheets="false">
    (function (c) {
        c.getFocusedPrimaryTabId(function (result) {
            c.setTabTitle("{!Case.CaseNumber}", result.id);
        });
    }(sforce.console));
</apex:page>

Fun gotcha, the getFocusedPrimaryTabId doesn't return anything. You can only access the primaryTabId from its callback. Also remember id is case sensitive, unlike in Apex.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.