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
DarkLightDarkLight 

Override View on Account Page for specific Roles only

I have created TabbedAccount page using visualforce, and I want it to be the default view for some of out Roles. Currently, if I override the View button - the change is across the board, and it hurts the Partner Portal users as they don't have privileges for all the related lists in the TabbedAccout Page. I can think on two optional solutions: 1. simple - allow only specific Roles to get the overriden settings. 2. complicated (but preferable) - update TabbedAccount visualforce code so it will not crash the account page if the user don't have the right privileges (how?).
Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

There's a good example and discussion in the docs at:

 

http://www.salesforce.com/docs/developer/cookbook/Content/vf_conditional_page.htm

 

its based on overriding for a specific profile, but can be easily adapted to your requirements.

All Answers

bob_buzzardbob_buzzard

If you provide an action method on the page element itself, that will invoke a method on the controller before the page is rendered.  This method can check the role of the currently logged in user and decide whether to continue with the current page or send the user off to the standard page.  

DarkLightDarkLight

Thank you for the prompt answer.

Can you please elaborate for a newbie, or refer me to the right article about Action method?

 

Thanks!

bob_buzzardbob_buzzard

There's a good example and discussion in the docs at:

 

http://www.salesforce.com/docs/developer/cookbook/Content/vf_conditional_page.htm

 

its based on overriding for a specific profile, but can be easily adapted to your requirements.

This was selected as the best answer
DarkLightDarkLight

Excellent - exactly what I was looking for!