function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Dan NapolitanoDan Napolitano 

Override Recently Viewed List View on Portal VisualForce Page

I am trying to redirect portal partner users to individualized list views on a custom VisualForce Accounts tab, based upon each user's portal role or profile (I've aligned the roles with the profiles). 

My custom VF page (named AA_Accounts_View) is this:
 
<apex:page readonly="true" tabStyle="Account">
    <apex:sectionHeader title="{!$objectType.Account.LabelPlural}" subtitle="My Sites"/>
    <apex:ListViews type="Account" />
    <style type="text/css">
    .actionColumn {display:none; visibility:hidden}
    </style>
    <apex:panelGrid columns="2" width="100%">
    </apex:panelGrid>
</apex:page>

I have been attempting to create a custom home page component, using either a VF page or an HTML area, to redirect each profile to its specific list view. Here is one of the custom HTML home page components I tried:
 
<script>
(document.getElementsByTagName('h2')[0])
.parentNode
.parentNode
.style.display = 'none';
if(window.location.pathname=='001/o')
location.replace('001?fcf=00BG0000009N1JS');
</script>

Here is a VF page I wrote to use as a home page component:
 
<apex:page readonly="true" tabStyle="Account">
    <apex:sectionHeader title="{!$objectType.Account.LabelPlural}" subtitle="My Sites"/>
    <apex:ListViews type="Account" />
    <style type="text/css">
    .actionColumn {display:none; visibility:hidden}
    </style>
    <apex:panelGrid columns="2" width="100%">
    </apex:panelGrid>
 <script type="text/javascript">
      parent.frames.location.replace("001?fcf=00BG0000009N1JS");                                          
 </script> 
</apex:page>

By the way, our portal URL manifests in the portal as:

https://ourcompany.force.com/portal/apex/AA_Accounts_View

I have set the VF page to the default landing page in the portal. Previously, the landing page showed as https://ourcompany.force.com/portal/001/o, but the redirects did not seem to work in that case, either.

I have been adding each home page component to its profile-based home page as a narrow component (Settings > Customize > Home > Home Page Layouts > Edit).

What I expected to happen using either of the home page components above is for the default home page to load and show the list view having the ID 00BG0000009N1JS, not recently viewed accounts. But Recently Viewed just keeps loading.

If anybody can help me understand what I am doing incorrectly, thanks very much.