+ Start a Discussion
domdickdomdick 

standard salesforce page redirect

Hello,

 

How can i make sure that just only few users should redirect to the custom visualforce page and rest of other should redirect to the standard add product service page when opportunity has been created?

 

Can someone please help with an example?

 

Thanks,

 

Devendra@SFDCDevendra@SFDC

Hi,

You can find the profile Id from the User record and also the name by quering on Profile.

 

You can do this custom controller class.

 

Id profileId = UserInfo.getProfileId();

List<Profile> lstPro = [Select Id, Name from Profile where Id=: profileId limit 1];
if(!lstPro.isEmpty() || && lstPro[0].Name == 'Some Profile 1'){
	<!-- Redirect to Place 1 -->
}else if(!lstPro.isEmpty() || && lstPro[0].Name == 'Some Profile 2'){
	<!-- Redirect to Place 2 -->
}

 

Thanks,

Devendra

domdickdomdick

Thanks devendra for the inputs.

 

But How can we implement / override this into standard Opportunity save functionality?

 

Let me explain the process... via standard SF page

1 - As a user if i am creating an opportunity then onSave click, it's redirecting to Pricebook selection and based on Pricebook selection, it's redirecting to SF standard service name selection

 

Now the challenge is... How can i override Opportunity standard onSave click, so it's redirect to custom VF page insted of standard Pricebook selection?

 

Any solution?

 

Thanks

 

 

Bhawani SharmaBhawani Sharma
You can override your Opportunity New page with a VF page and can override the Save method. From this method, you can decide your navigation as suggested by Devendra.