Happy Business Starts Here

Highlighted
Valued Scholar

How does it work? - calculateChargesOnQuantityChange method on zQuoteUtil class

Can anyone give me a real world example of why and how you could use the calculateChargesOnQuantityChange method on zQuoteUtil class?

 

One of the reasons I'm asking is because I see that a previous developer has added code to a before trigger on the Quote Charge object which re-calculates some of the values due to a quantity change. I'm just wondering if some of the zQuoteUtil methods might be used in future development.

Note our production is on an older version, 6.2.1 and can't take advantage of some of the newer stuff like the PreviewQuotes feature.

 

 

3 REPLIES 3
Guru

Re: How does it work? - calculateChargesOnQuantityChange method on zQuoteUtil class

I am not sure why your developer is using it - do you have a custom UI to edit products?

 

We do have a custom UI to modify charges on a quote, so I do use this util call if the quantity is changed.

 

If you are using standard OOTB Zuora for salesforce you shouldn't need it.

 

Maybe if you posted some code from your trigger we might see what the original developer was doing.

Maggie Longshore
Valued Scholar

Re: How does it work? - calculateChargesOnQuantityChange method on zQuoteUtil class

No, we are not currently using the method. I was just asking how to use it. What we ARE doing in the trigger is increasing the quantity to the Max qty of the tier. Example, I'm selling eggs. I sell in qtys of 12 & 18. Tier 1 is 1-12 eggs and Tier 2 is 13-18 eggs. If the sales person keys in 13 eggs in the guided selling screen, the before trigger looks at the tier it is in and bumps the 13 egg order up to 18. 

 

To make this example more realistic in our environment, suppose included with your egg order you have to purchase a delivery fee. To assist our sales people, there is code to bump the delivery fee up to Tier 2 (in case the person forgets to change the qty). With this increased qty, the totals are being recalculated in the trigger. 

 

If I need to rewrite the code one day (or need to write something similar), I was wondering if I could, or should, use the baked in zQuoteUtil methods to do the calcs rather than do them myself (in code).

 

 

Guru

Re: How does it work? - calculateChargesOnQuantityChange method on zQuoteUtil class

Yes you should use that method after you change the quantity in code.

Maggie Longshore