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
imran Rahmanimran Rahman 

Different VIEW behavior for Custom Object of Portal Users

I have a custom VisualForce page for Viewing items in a particular Object, I would like however the view to be only be shown for Portal users, for all other users it should display the normal SF pages.

I have found a solution already but it feels quite 'hackish' because when non portal users view it they are shown the development page for the visual page very breifly before being redirected to the normal SF view page.
This is the code if it makes more sense:
<apex:page standardController="News__c" action="{!if($Profile.Name =='Heathrow Portal', null,
        urlFor($Action.News__c.View, News__c.Id, null, true))}">

I want to know if there are any other ways I can implement this behavior?
bob_buzzardbob_buzzard
That is the correct way of redirecting users based on profile.  The non-portal users shouldn't see the Visualforce page contents, they just hit a blank page before they are redirected to the correct page.  There's no other way to acheive this I'm afraid - the earliest place you can check and redirect is in the Visualfore page.