Skip to main content
added stuff
Source Link

I've got a Junction Object, Product_Dependencies_Association which has a Mast-Detail Relationship to a My_Custom_Product__c Object named Child_Product__c and a Lookup relationship (not Master-Detail) that also points to a My_Custom_Product__c Object named Parent_Product__c.

The Child_Product__c relationship's Child Relationship Name is Child_Product_Relationship.

My question is, why won't the following query work?

[select (SELECT Name FROM Child_Product_Relationship__r) FROM Product_Dependencies_Association__c]

It fails with `Error:

Compile Error: Didn't understand relationship 'Child_Product_Relationship__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.`

Interesting to note: https://workbench.developerforce.com reports the relationshipName for the Child_Product__c relationship as Child_Product__r, not Child_Product_Relationship__r as I defined within the Salesforce UI. I've also tried Child_Product__r and Child_Product_Relationship in the query and get the same error.

Details of the Child_Product field, as requested: Child Product field

I've got a Junction Object, Product_Dependencies_Association which has a Mast-Detail Relationship to a My_Custom_Product__c Object named Child_Product__c and a Lookup relationship (not Master-Detail) that also points to a My_Custom_Product__c Object named Parent_Product__c.

The Child_Product__c relationship's Child Relationship Name is Child_Product_Relationship.

My question is, why won't the following query work?

[select (SELECT Name FROM Child_Product_Relationship__r) FROM Product_Dependencies_Association__c]

It fails with `Error:

Compile Error: Didn't understand relationship 'Child_Product_Relationship__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.`

Interesting to note: https://workbench.developerforce.com reports the relationshipName for the Child_Product__c relationship as Child_Product__r, not Child_Product_Relationship__r as I defined within the Salesforce UI. I've also tried Child_Product__r and Child_Product_Relationship in the query and get the same error.

I've got a Junction Object, Product_Dependencies_Association which has a Mast-Detail Relationship to a My_Custom_Product__c Object named Child_Product__c and a Lookup relationship (not Master-Detail) that also points to a My_Custom_Product__c Object named Parent_Product__c.

The Child_Product__c relationship's Child Relationship Name is Child_Product_Relationship.

My question is, why won't the following query work?

[select (SELECT Name FROM Child_Product_Relationship__r) FROM Product_Dependencies_Association__c]

It fails with `Error:

Compile Error: Didn't understand relationship 'Child_Product_Relationship__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.`

Interesting to note: https://workbench.developerforce.com reports the relationshipName for the Child_Product__c relationship as Child_Product__r, not Child_Product_Relationship__r as I defined within the Salesforce UI. I've also tried Child_Product__r and Child_Product_Relationship in the query and get the same error.

Details of the Child_Product field, as requested: Child Product field

Source Link

Subquery in Junction Object, can't get relationship

I've got a Junction Object, Product_Dependencies_Association which has a Mast-Detail Relationship to a My_Custom_Product__c Object named Child_Product__c and a Lookup relationship (not Master-Detail) that also points to a My_Custom_Product__c Object named Parent_Product__c.

The Child_Product__c relationship's Child Relationship Name is Child_Product_Relationship.

My question is, why won't the following query work?

[select (SELECT Name FROM Child_Product_Relationship__r) FROM Product_Dependencies_Association__c]

It fails with `Error:

Compile Error: Didn't understand relationship 'Child_Product_Relationship__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.`

Interesting to note: https://workbench.developerforce.com reports the relationshipName for the Child_Product__c relationship as Child_Product__r, not Child_Product_Relationship__r as I defined within the Salesforce UI. I've also tried Child_Product__r and Child_Product_Relationship in the query and get the same error.