function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ade12Ade12 

Rental Opportunities and Quotes

Currently our salesforce site only provides opportunities and quotes for outright sales. I am attempting to update these pages so they will also provide details for rentals. To do this I intend to provide a rental checkbox. 

 

I have added the checkbox to the opportunity page using page layouts but need to be able to extend the controller so it can detect if the checkbox has been checked when the New Quote button is clicked. If it has I want to redirect the user to a quote page which shows the rental details (pulling the device details and quantities from the opportunity page) instead of the outright sales details.

 

How do I extend the controller for the opportunity page layouts?

 

bob_buzzardbob_buzzard

The standard pages don't have controllers - they aren't built on Visualforce.  You'd need to override the create with your own Visualforce page to get that level of control.  You could replace the new quote button with one of your own that goes to a visualforce page, and in the page action method check if the rental checkbox has been filled in.  If it hasn't, send the user to the  regular quote page, if it has, keep them on your visualforce page.