In ZQuotes simplify query to populate product list on Select Products Page
When the product lookup button is clicked on the Select products page the following query is run:
WHERE (Currency__c = :tmpVar1 AND ProductRatePlanCharge__r.ProductRatePlan__r.zProduct__r.Deleted__c = FALSE)
GROUP BY ProductRatePlanCharge__r.ProductRatePlan__r.zProduct__r.Id
Here is the warning data:
Number of SOQL queries: 5 out of 100
Number of query rows: 32664 out of 50000 ******* CLOSE TO LIMIT
In our sandbox it has exceeded the limit and failed.
This multiple join query uses too many rows which can exceed SF governor limit of 50,000 rows making the control unusable.
This situation is because you are only displaying products that have charge tiers in the currency used.
Couldn't you simply just show the list of products and filter on currency later if you need to. of course there are many ways you can solve this but it needs to be solved as we will be adding more products to our catalog which will break our Zuora implementation.
Also I noticed this query is executed every time the button is hit instead of using caching. The select product page could be much more responsive to the user if some simple optimizations were made to the code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.