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
Frank CarterFrank Carter 

override quote button

Hello, 
I have a problem, I have the new Quote button but before the creation I have to do some checks on opportunity's fields. If conditions are verified it has to show me a pop up error otherwise it must open the new quote page. I thought about doing it overriding standard new quote with a vf page with inline Javascript. The problem is the vf page have the standar quote controller. How can I get the opportunity record on which I am?
Can someone explain me this? is this a correct approach? there is another way?
Thanks
Raj VakatiRaj Vakati
You can use simple Javascript Ajax Button to do it .. create a list button javascriot
 
// Loading the ajax toolkit data
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/10.0/apex.js")}

// Making a call to the webservice method
Get the Opp value List Button 

// If the value is 0 or blank            
if(value == 0 || value == ''){
   // Redirect to the Page
else{
   // Redirect to standard page 
}

 
Frank CarterFrank Carter
Thank you for your answer, the problem is that javascript button is not supported in Lighnting so I wanted to try another approach.
thanks
Raj VakatiRaj Vakati
You need to use the quick action .with action override 

 
Frank CarterFrank Carter
I have to use lightning component?
Frank CarterFrank Carter
nobody can explane me what are the steps to reach the desired result?

Thanks