I have included a piece of my apex class from a customized product selector. What I am trying to do is to create a custom button on my visualforce page and direct my users to the new quote they want to create from the products they have selected on the opportunity. When Input the code below I get this error:
Unable to Access Page The value of the "oppid" parameter contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and resubmit. If the error still persists, report it to our Customer Support team. Provide the URL of the page you were requesting as well as any other related information.
Is there another way I can get the products they select to save onto the opportunity and create a quote (go to the quote new edit page) all within the same button?
public PageReference onCreateQuote(){
// If previously selected products are now removed, we need to delete them
if(forDeletion.size()>0)
delete(forDeletion);
// Previously selected products may have new quantities and amounts, and we may have new products listed, so we use upsert here
try{
if(shoppingCart.size()>0)
upsert(shoppingCart);
}
catch(Exception e){
ApexPages.addMessages(e);
return null;
}
return new Pagereference('/0Q0/e?retURL=%2F{!Opportunity.Id}&oppid={!Opportunity.Id}');
}