Happy Business Starts Here

Newly Enrolled

Syncing Zuora Products on Quotes with Opportunity Products on Opportunities,

Hey Community,

 

I've been asked to set up the Zuora Quote Products to sync bi-directionally with the Salesforce Opportunity record to which it it is connected, so that a user can add/remove or update on either record and it would autosync to the other.

 

I am having a hard time finding documnetation on how to do this and I am wondering if this is even possible.  Any help would be greatly appreciated.

 

Roy

6 REPLIES 6
Zuora Alumni

Re: Syncing Zuora Products on Quotes with Opportunity Products on Opportunities,

It's a customization for sure (most likely an Apex trigger unless Salesforce has new tools I dont know about like Process Builder).

 

You could probably do a sync from Quote Rate Plan Charge to Oppty Product, but the other way is a bit tricky unless you store some link to the QRPC on the Oppty Product.

 

From QRPC to Oppty Product the psuedo logic would probably go something like this:

-Take all QRPCs and roll them up to the related Product2 record. You'd have to decide what Pricing field to roll up.

-Take that number and upsert the record into Oppty Product object and put the rollued up Price in the Price field. 

 

FYI we will be delivering a Parimary Quote flag in Quotes 7.3 in July so you can use that to identify the Primary Quote for an Oppty. 

Newly Enrolled

Re: Syncing Zuora Products on Quotes with Opportunity Products on Opportunities,

Your suggestion gave me a small glimmer of hope, but so far, no love.  Any idea what other Salesfroce Orgs do to keep the Z Quote inline with the oppportunity without doing double entry?

Zuora Alumni

Re: Syncing Zuora Products on Quotes with Opportunity Products on Opportunities,

Exactly what I suggested above :-)

 

I wouldn't do Oppty Prod to QRP/QRPC sync as that is tricky.  I'd drive everything on the Oppty Prod from QRP/QRPC, one way.

 

Of course it forces the user to create a Quote in order to populate Oppty Products....

Newly Enrolled

Re: Syncing Zuora Products on Quotes with Opportunity Products on Opportunities,

Hey Nathan,

 

I think you have the knowledge I need, but these posts don't lend themselves to deep dives.  Is there any chance I could schedule a GTM with you to get a more detailed discussion?

Valued Scholar

Re: Syncing Zuora Products on Quotes with Opportunity Products on Opportunities,

See below of some SAMPLE code on how to write a trigger on the quote charge object which creates Opportunity Line Items.  Please remember, this was sketched out in Notepad and has not been debugged.

 

trigger QuoteCharge_Update on zqu__QuoteCharge__c ( after update)
{
// Step 1. Declare list to hold newly created opp line items.

List<OpportunityLineItem> listOli = new List<OpportunityLineItem>();

// Step 2. Get Opportunity ID via soql query using keyset of trigger
map<string, string> mapQuoteChargeInfo = new map<string, string>([ select id, zqu__Quote__r.zqu__Opportunity__c
from zqu__QuoteCharge__c
where zqu__Quote__c =:trigger.newMap.keySet()]);

//Step 3. Loop through items in trigger
for(zqu__QuoteCharge__c zQuoteCh1: Trigger.new)
{
oli = new OpportunityLineItem();
oli.OpportunityId = mapQuoteChargeInfo.get(quoteCharg1.id);
oli.Quote_Charge__c = quoteCharg1.id;
oli.List_Price_Custom__c = quoteCharg1.zqu__ListPrice__c;
oli.Description = quoteCharg1.zqu__Description__c;

listOli.add(oli);

}

// Step 4 If any items in the list, insert into the db.
if(listOli.size() > 0
{
insert listOli;
}
}

Guru

Re: Syncing Zuora Products on Quotes with Opportunity Products on Opportunities,

@roymoore The important thing to remember here on syncing is that a Zuora Quote charge contains much more information than an Opportunity Product does. Therefore this lends itself best to a one-way sync. As @nathanc mentioned and @ccalhoun11 gave an example of, it is very easy to use a trigger to take the details from a quote a copy them to the Opportunity product line items. 

 

If you tried to sync from Opportunity Product to a quote, how would you chose which rate plan to go with?

 

A couple things to think of:

 

1. If you have multiple quotes per opportunity which do you want to sync over (the latest edited?, a particular one?) Zuora usually copies the total from the most recent to the Opportunity. In our case we do this, but when a quote is booked (sent to z-billing) we then overwrite with its details. The upcoming "Primary Quote" flag in 7.3 will help out with this as well (awesome news @nathanc)

 

2. Which charge details do you want to collect on the opportunity product. In our case each of our products has 3 rate plans for monthly, annual, or prepaid billing options and then each rate plan has 4 charges: a platform fee that is recurring and 3 usage charges. In our case when we rollup the charge details to the rate plan and product we do so on the platform charge as it is most relevant to reporting and pricing. But all of this is specific to your business and how you have designed your catalog.

 

3. One idea that would be interesting for the Opportunity Product -> Quote "sync" is to use the default values plugin to grab the Opportunity Products from the Opportunity and auto add them to the quote based on some default assumptions. (For example you could have a "default" rate plan that gets selected). This might allow you the simplicity of quickly building a quote from an opportunity that just had the Opportunity Products and then you could always change the rate plan on the quote if necessary. After that, the quote would then drive the opportunity products and become the master record.

 

Hope this gives you some good ideas on how best to move forward.

 

Cheers,

Jacob