Happy Business Starts Here

Zuora Alumni

Can I setup an approval process before a quote is sent to Zuora?

Question: Can I setup an approval process before a quote is sent to Zuora?



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

6 REPLIES 6
Highlighted
Zuora Alumni

Re: Can I setup an approval process before a quote is sent to Zuora?

In Zuora for Quotes version 7.1 and a new field was added to the Quote object to allow the use of standard Salesforce Approvals. Used in conjunction with the new Approved Quote Status custom setting in Quote Configuration Settings, the field allows you to specify the particular status that should represent an “Approved” quote. The quotes in that status will be sent to Zuora via the Send to Z-Billing functionality.

You can add or remove the available status values by editing the picklist on the new Approval Status (zquApprovalStatusc) field on the Quote object to define your own approval statuses.

This field is backward compatible, and if you do not want to use the field, it does not affect existing quotes.

Note that you need to define your own status transitions for how a quote moves through the approval lifecycle.

 

The default values are:

 

Ready for Approval
In Progress
Approved
Rejected

 

Note: You can create approval processes in Salesforce by going to Setup-->Create-->Workflow and Approvals-->Approval Processes

For information on how to setup an approval process in Salesforce refer to Set Up an Approval Process



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

Savvy Scholar

Re: Can I setup an approval process before a quote is sent to Zuora?

 

I am just trying this approach and it does not look like the quote wizard respects the record locking of the approval process,  it seems to be possible to change the quote once it has been approved and before the quote is submitted.   (which sort of defeats the approval process)

 

Have i missed something in the setup or is this expected?  I was hoping that once the quote was approved it would not be possible to modify the pricing.  

 

The only work around that i can think of is to add a trigger on the quote change object to prevent them being updated or inserted on an approved quote 

Zuora Alumni

Re: Can I setup an approval process before a quote is sent to Zuora?

Hmn we should respect this....do you mean while its going through approvals in Salesforce you would expect all pages of the qizard to be read only?  or to not even be able to go into the process?

Savvy Scholar

Re: Can I setup an approval process before a quote is sent to Zuora?

Yes, once in the approval process or approved it should not be possible to update anything on the quote.    The standard salesforce approval process  locks the record so that no updates can be made.   This is happening when you add an approval process to the quote, however visualforce pages are able to bypass the lock and make updates - which is what is happening with the wizard.

We have managed to impement a workaround by adding a validation rule to the zqu__QuoteRatePlanCharge__c object as detailed below.  This prevents any changes to the charges if the quote is in the approval process.  It doesn't prevent update to the quote but that is less of a problem in our scenario provided charges cannot be modified.

 We also needed to create a custom 'Generate PDF' that prevented the quote document being created unless the quote was approved.   The config for this is also below.

 

Create  >  Objects > Quote Rate Plan Charge > Validation Rules

 

Validation Rule Detail 
Rule NameLock_Charges_when_appovedActiveChecked
Error Condition Formulaor ( text(zqu__QuoteRatePlan__r.zqu__Quote__r.zqu__ApprovalStatus__c) == 'In Progress',
text(zqu__QuoteRatePlan__r.zqu__Quote__r.zqu__ApprovalStatus__c) == 'Approved'
)
Error MessageThe quote cannot be modified once in the approval process. Reject the approval to allow update.Error LocationTop of Page
Description

 

Create  >  Objects > Quote  > Validation Rules > New Button or Link

 

LabelGenerate Approved PDFObject NameQuote
NameGenerate_ApprovedPDF  
BehaviorExecute JavaScriptDisplay TypeDetail Page Button
OnClick JavaScript

if ( '{!zqu__Quote__c.zqu__ApprovalStatus__c}' != 'Approved') {
alert('Only approved quotes can be generated');
} else {
var dwidth=1024;
var dheight=600;
var dtop=window.screen.availHeight/2-dwidth/2;
var dleft=window.screen.availWidth/2-dwidth/2;
var pageURL = window.location.hostname;
window.open('https://'+pageURL+'/apex/zqu__zqgeneratepdf?SID={!$Api.Session_ID}&SURL={!$Api.Partner_Server_URL_100}&QID={!zqu__Quote__c.Id}&format=pdf','newwindow','height='+dheight+',width='+dwidth+',top='+dtop+',left='+dleft+',toolbar=0,menubar=0,scrollbars=1,resizable=0,location=0,status=0');
}

 

 

 

 

 

 

Zuora Alumni

Re: Can I setup an approval process before a quote is sent to Zuora?

This is excellent information to add to the solution, thanks.    I am thinking of adding this to the Knowledge Center perhaps since approval processes are so fundamental to the front office.

 

Regarding if we could make a product change, we can consider it but if the workarounds are not too onerous (which it sounds like they are not?) we could perhaps invest that effort elsewhere?

Savvy Scholar

Re: Can I setup an approval process before a quote is sent to Zuora?

The work around has some limitations, you can still change values on the quote,  eg payment method or credit terms.  

 

I don't think we can use validation rules to prevent that as i doubt that you would be able to send the quote to zuora as there are certain fields that need to be updated once the quote is submitted and these would be blocked by the rule.   You could develop a trigger that allowed some fields to change, but that is making the workaround a whole lot harder.  Maybe there is another way?

 

So whether this workaround will be appropriate depends on the business requirements, if you are comfortable that fields on the quote could change after approval and that only changes to pricing are locked down then this would work.

 

Incidentally, there is a problem creating approval emails as the 'Quote' object has the same name as a standard object.  This means that you can't select merge fields in the dropdown box and you need to enter these manually.

 

eg The quote name is field {!zqu__Quote__c.Name}  and zuora supplied fields are prefixed with zqu, eg {!zqu__Quote__c.zqu__TCV__c}

 

The other problem this naming causes, is that you can't preview the email template against existing objects.  ie when you click "Send Test and Verify Merge Fields" you are unable to select the managed package quote object.   To work around this you need to change the url to do a preview, ie to preview against a quote xxx then you need to add ?related_to_id=xxx to the email template url and this will show you a preview against the quote .