You need to sign in to do that
Don't have an account?

Conditional Tabbed Objects
I have created tabbed pages with accounts, leads, contacts etc and would like to give users the option to either use these new visualforce pages or stick with the standard layouts. Looking through the force.com cookbook I came across the following:
<apex:page action= "{!if($Profile.Name !='System Administrator', null, urlFor($Action.Account.Tab, $ObjectType.Account, null, true))}" ... >
Rather than making it conditional on ones profile I'd like to make it conditional on a custom field on the user record called 'Tabbed_Objects__c'. Can anyone help me modify the above to show the standard account or tabbed account based on this checkbox?
Thanks in advance!
Hey
You would need to pass the ID of the tabbed_objects__c and Account to the page and you would have to change the page thus
<apex:page standardController="Tabbed_objects__c" action= "{!if($Tabbed_objects__c.pageToUse__c !='standard', urlfor($Page.MyAccountPage), urlFor($Action.Account.Tab, $ObjectType.Account, null, true))}" ... >
This may not be exactly what you need but it should get you started.
Cheers,
Wes
All Answers
Hey
You would need to pass the ID of the tabbed_objects__c and Account to the page and you would have to change the page thus
<apex:page standardController="Tabbed_objects__c" action= "{!if($Tabbed_objects__c.pageToUse__c !='standard', urlfor($Page.MyAccountPage), urlFor($Action.Account.Tab, $ObjectType.Account, null, true))}" ... >
This may not be exactly what you need but it should get you started.
Cheers,
Wes
Thanks for the help. I still need to change this part:
urlFor($Action.Opportunity.Tab, $ObjectType.Opportunity, null, true)
By the way, this was the solution:
action="{!if($User.Tabbed_Layouts__c, null, urlFor($Action.Opportunity.View, Opportunity.Id, null, true))}"