I would like to have an commandLink which will link to the cases tab but will open it with a specific view displayed. Is that possible? Is there a way to tell the tab to open showing a specific view?
1 Answer
Please replace ListId with Id of listview to display on visualforce page.Lets name the below page as AccountListView
<apex:page>
<apex:enhancedList type="Account" height="300" rowsPerPage="10" id="AccountList" listId="00BE0000003WyhN"/>
</apex:page>
Lets say this is your extension class.Add accountlistview page to the pagereference.
public with sharing class myextension {
public myextension(Account controller) {
}
public pageReference callAnotherPage(){
PageReference pageRef = new PageReference('/apex/accountlistview');
pageRef.setRedirect(true);
return pageRef;
}
}
Lets say this is your actual page
<apex:page controller="Account" extensions="myextension">
<apex:form>
<apex:commandlink action="{!callAnotherPage}" target="_blank">
<apex:commandButton value="Switch"/>
</apex:commandLink>
</apex:form>
</apex:page>