Happy Business Starts Here

Highlighted
Guru

Overriding New Quote Button

I am attempting to override the Create Quote Button on the Opportunity page.

 

In certain cases I am taking the user to a custom VF page to prevent the quote from being created.

 

Otherwise I want the user to continue just as if they had pressed the OOTB Create Quote button.

 

In Apex, how do I redirect the page into the quote Wizard and what parameters should I set for it to work?

 

@feisley @doyeli or anyone else with knowledge of this.

Maggie Longshore
3 REPLIES 3
Guru

Re: Overriding New Quote Button

The button is set to open a VisualForce page:

 

/apex/QuoteOption?scontrolCaching=1&id={Opportunity.Id}

 

So you just need to make sure your first VisualForce page (with your custom logic) will redirect to that "QuoteOption" one and pass it the Opportunity ID as a parameter.

 

Note this is in the "zqu" namespace, so you either need to manually set the hostname or do zqu__QuoteOption when referencing the URL (my example above came from the zqu custom domain so it had it omitted.

Guru

Re: Overriding New Quote Button

Thank you very much.  This worked for me.

Maggie Longshore
Support SME

Re: Overriding New Quote Button

Thank you very much @feisley.

Hi @MaggieL, sorry, I was out of office last week, so couldn't respond back earlier.

I also had tried the similar requirement for another customer , earlier.

The requirement was that if a custom field instance_c in Opportunity record was not populated, I needed to redirect  the user to the custom “SearchInstanceOnOpportunity” page.
otherwise I needed to send them to the “zqu__QuoteOption” page .

I had created a custom create Quote button that had the following java script:

 

var instanceId = '{!Opportunity.Instance__c}';
if (instanceId == '') {
window.open('/apex/SearchInstanceOnOpportunity?id={!Opportunity.Id}&redirectToQuote=true', '_self');
} else {
window.open('/apex/zqu__QuoteOption?id={!Opportunity.Id}', '_self');
}


Glad to know that you could make it work.

 

Thank you BOTH






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √