You need to sign in to do that
Don't have an account?
Debbie Grueter
Replace the "New" button on the Opportunity Home Page with a Visual Force Page
I want to replace the New Button on the Opportunity Home Page with a visual force page. As I don't want my users to have the option to create a new opportunity from the this opportunity page. I want to enforce that they only create a new opportunity from a Contact Record. Has somebody done this recently? If so could you share the speciciications with me so that I can build this myself and save some time?
The VF page code would be something like below :- If this helps,please mark it as best answer to help others :)
If you just want to show an error message instead, you could do something like:
<apex:page title="Not Allowed" standardStylesheets="true" standardController="Opportunity">
<div style="font-size: 16px; font-weight: bold; margin: 2em 0;">This operation should only be performed in the Contact Record Page</div>
</apex:page>
You could also add some javascript to redirect the page to the contact record after 5 seconds or so, but then you'd have to get the id of the Contact Record using an extension controller.
Below is an article on how to override standard pages
http://rjpalombo.com/2012/04/override-a-standard-salesforce-page-with-visualforce/
Hope this helps !!
somehting like :-
<apex:page standardController="Opportunity">
1.) Go to Setup -> Opportunity ->Button,Links,Actions -> Click on New
Create a button with Following attributes
Display Type = List Button
Behaviour = Display in existing window without sidebar or header
Content Source= URL
Then,the URL box put this code
/006/e?CF00N90000004mprm={!Contact.Name}&CF00N90000004mprm_lkid={!Contact.Id}&retURL=%2F{!Contact.Id}
Name and Save this button.
2.) Now go to Contact Layout ->Edit -> Go to related List Opportunity -> Click on Sign just beside (-)sign which says Related List Properties -> Click on buttons in new Window - > Uncheck the New button -> Under Custom buttons select the button you just created
Save this Layout and you are good to go :)
If this helps,please mark this as best answer to help others :)
I am also facing same issue, is there any luck?
Did you find any solution?
Ex:
if(user.Profile.Name.equals(PARTNER_PROFILE)){ PageReference pr = new PageReference('/partner/006/e?retURL=%2Fpartner%2F006%2Fo&nooverried=1'); return pr;
Hi Debbie,
You can override the new button using vfpage and for the related list, the button removes the standard new button and add your custom JavaScript button in the related list. So in that way you can use the different buttons in the related list.
You can't bypass this. What issue you are getting from the page? You can write down all your javascript button logic into your VF page to do all operations.
If you find this helpful mark it as the best answer.