I want to display the standard Salesforce page after clicking on 'New' button for some conditions and for others I want to override the 'New' button with a VF page. I am not really sure what should be the correct approach to solve this tricky situation. Any suggestions will be really appreciated.
1 Answer
Here is a VF solution expanding on Mark's comment. The fourth argument to URLFOR is nooverride
<!-- Display markup when running user is Switzerland, otherwise, use standard page -->
<apex:page standardController="Foo__c"
action="{!IF($User.Country__c = 'CH',
NULL,
URLFOR($Action.Foo__c.New,null,null,true)
)}"
<apex:form>
<!-- my override markup goes here -->
</apex:form>
</apex:page>
nooverride=1
in the URL, or it would redirect the user to the custom destination to create a new record.