Happy Business Starts Here

How to handle validate a quote when Send to Zuora button is pushed?

Krzysztof
Honor Student

How to handle validate a quote when Send to Zuora button is pushed?

Hi there 

 

I would like to validate what is being sent to Zuora when this default button Send to Zuora is pushed but I'm not certain what trigger or event should I look for to take over the control of the process?

 

I am aware of zQuoteUtil.sendToZBilling method but I think it could be useful in other scenarios e.g. when someone would like to create his custom button with the same effect - sending a quote to the billing.

 

The field I want to update during this event is the Invoice Target date. By default, this field is populated with the current date (today) but this is happening when a new subscription quote is created so it could be out of date when someone actually would revisit this quote and would send it to Zuora.

 

This has actually already happened, so the Send to Zuora was made in February, and this is when the invoice was generated but the invoice of this date was pointing back to January when the Quote was created.

 

Any suggestions? 

7 REPLIES 7
MaggieL
Guru

Re: How to handle validate a quote when Send to Zuora button is pushed?

https://community.zuora.com/t5/Zuora-CPQ/Simple-Validation-to-prevent-Sending-to-ZBilling/m-p/17334#...

 

This answer may help.  I created a new button that wraps the out of the box button to ensure the quote is valid.

 

You could do this with a visualforce button and invoke code to do what you would like done.

Maggie Longshore
Krzysztof
Honor Student

Re: How to handle validate a quote when Send to Zuora button is pushed?

Hi Maggie and thanks for the reply. I've seen your posts before but they are not what I am looking for.

  1. I don't want to create another button, I want to catch the event/trigger which is related to the default "Send to Zuora" button when this one is being pushed
  2. zqu__ApprovalStatus__c is nice to have but still, I'd like to change this status field programmatically during the validation process, but the problem is how to get into that event context?
MaggieL
Guru

Re: How to handle validate a quote when Send to Zuora button is pushed?

There is no trigger in Salesforce for before the event of sending a quote to Zuora.

 

They have plugins for many events but have not seen any for this - it would be great to have this ability.

 

We send quotes to Zuora several ways - not always through the button.  We do many validations and updates to quotes in the quote triggers.

 

If the button on the quote page is the only way you are trying to intercept, you can place a component on the quote detail page that runs when the quote is opened.  We have several of these on the quote.

Maggie Longshore
Krzysztof
Honor Student

Re: How to handle validate a quote when Send to Zuora button is pushed?

Thanks for that confirmation, this is what I was guessing but wasn't sure.

 

On the other hand, I found some definition in Process Builder which changes the status of opportunity to won when the Status = Sent to Z-Billing. Looks exactly like a case I was looking for so I'm not certain how is that possible without having such trigger in Apex?

 

Also just wondering if updating such field like Invoice Date as the next action on such Process Builder would be possible or is it better to call the Apex method directly from the Process Builder to perform such change? 

MaggieL
Guru

Re: How to handle validate a quote when Send to Zuora button is pushed?

 

On the other hand, I found some definition in Process Builder which changes the status of opportunity to won when the Status = Sent to Z-Billing. Looks exactly like a case I was looking for so I'm not certain how is that possible without having such trigger in Apex?

 

This is happening on the quote trigger after the sale has gone to Zuora not before.

 

 

 

 

Maggie Longshore
Krzysztof
Honor Student

Re: How to handle validate a quote when Send to Zuora button is pushed?

How do you know such things?

Is there any logic flow diagram somewhere?

MaggieL
Guru

Re: How to handle validate a quote when Send to Zuora button is pushed?

The way events flow for buttons and triggers is standard Salesforce - this is not tied to Zuora - just knowledge from being a developer on Salesforce, you can look on trailhead to learn more.

 

Your best bet is going to be to create a new Send to Z-Billing button that makes the changes you want  to the quote then redirect user to the process quote page so they can submit.

 

You will want to hide the standard Zuora button.

 

 

 

Maggie Longshore