Our company has a custom product selection tool on a visualforce page with its own apex class for the opportunity line item section. Is there a way I can create a custom button on the quote page that redirects to that opportunity line item's visualforce product selection page?

I have tried to reference it via URL but can't seem how to input the id into the url. I have tried creating a new apex class and visualforce page to redirect to that pagereference, but I keep getting this error: System.TypeException: Invalid conversion from runtime type SOBJECT:Quote to SOBJECT:Opportunity Class.QuoteExtController.: line 6, column 1

I also tried javascript as well on the button but kept getting the URL no longer exists message.

As a last resort I recreated the product selection tool for the quote line items and attempted to add that class as an extension on the opportunity visualforce product selection page.

Any ideas would be very helpful! Thank you :)

1 Answer 1


I ended up figuring this one out. I added the Opportunity Id field to the Quote Page layout through a formula field and then referenced that field in the URL custom button area. So the URL custom button looked like: /apex/ServiceRecordLayoutButton?id={!Quote.Opp_Id__c}

  • I'd suggest marking this as the answer then ;) Sep 8, 2014 at 14:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .