Happy Business Starts Here

Bug: Field zqu__ProductRatePlanCharge__c.zqu__ProductRatePlan__c doesn't set child relationship name

0 Kudos

Bug: Field zqu__ProductRatePlanCharge__c.zqu__ProductRatePlan__c doesn't set child relationship name

When zuora quotes is installed, it creates a number of related custom objects in Salesforce. Best practice is to give these relationships meaningful names, especially in a managed package, because the user will not be able to change the child relationship names.


The field zqu__ProductRatePlanCharge__c.zqu__ProductRatePlan__c does not set the child relationship name. Thus, querying zqu__ProductRatePlanCharge__c and its child objects requires a very ugly query like: 



select id, name, 
(select id from zqu__product_rate_plan_options__r),
(select id from zqu__product_rate_plan_charge_options__r),
(select id from zqu__quotechargedetails__r),
(select id from zqu__R00N40000001mFVKEA2__r)
from zqu__productrateplan__c


See the following dump of this part of the schema:




The same issue applies to zqu__quotecharge__c.zqu__productrateplancharge__c:





and zqu__productrateplancharge__c.zqu__productrateplan__c.



Zuora Alumni

Hi @bolaurent, as I just now sent you an email from the Ticket, the child relationship name has been explicitly set to R00N40000001mFVKEA2 in a previous version of the package. We agree it's ugly BUT it is the actual field name, and will not (and can not) change between orgs, so it can be safely used in queries.

Unfortunately , based on the following Article , Custom Field > Child Relationship Name cannot be changed once it's released in a managed package.



Sorry for any inconvenience


Thank you



Thank you @doyeli. I have moved this conversation to a bug report against salesforce's packaging manager.

Zuora Alumni

Thank you @bolaurent.