There is an issue with overriding Opportunity view for some particular profile.Currently We are redirecting the profile users to a VF page by default.
we have a button in our VF page, which takes the user to the standard view if he wants. In that case I am sending an url parameter as 'classic' and taking the user to standard page.
so my code is like this :
public PageReference reDirect(){
PageReference pr = null;
if(user has profile1){
if(ApexPages.currentPage().getParameters().get('type') == 'classic'){
pr = new PageReference('/'+opp.id+'?&nooverride=1');
pr.setRedirect(true);
}
else{
pr = new PageReference('/apex/dealwizard?id='+opp.Id);
pr.setRedirect(true);
}
}
else if(opp.RecordTypeId==sales){
pr=new PageReference('/'+opp.id+'?&nooverride=1');
pr.setRedirect(true);
}
return pr;
}
But now the problem is this -- After getting redirected to Standard view , If I try to inline edit some field and click save , it is taking me to my VF page :( I am unable to rectify it.How to make it stay in Standard Page when I edit and save.
My VF page controller has the following logic:
public PageReference goToClassicView()
{
if(user has profile1){
return new PageReference(Label.SFDC_Server_URL + opportunityObj.Id+'?type=classic&saveUrl=/'+opportunityObj.Id+'&nooverride=1');
}else{
return new PageReference(Label.SFDC_Server_URL + opportunityObj.Id);
}
}