I have written a visualforce page with a button and i want that when it's pressed there is a redirect to the standard page ADD PRODUCT!(the page that is opened when you click OPPORTUNITY--->ADD PRODUCT)
The URL is salesforce.com/p/opp/SelectSearch?addTo=006E000000AVjws&retURL=%2F006E000000AVjws
I have written the following code but it doesn't work:
<apex:form >
<apex:commandButton value="Add Product" action="{!addProduct}">
</apex:commandButton>
</apex:form>
public class tempsection {
public PageReference addProduct(){
Id conids='006E000000AVjwsIAD';
String newPageUrl = '/p/opp/SelectSearch?addTo='+conids;
PageReference p = new PageReference(newPageUrl);
p.setRedirect(true);
return p;
}
}
Is the Opportunity ID the only necessary?
Thank you in advance for any advice.
BR