function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Dev87Dev87 

Two Queries in the same time -> error

Hello, 

I have to query 2 objects in the same time (not parent child requet between objects)
Object 1 may have 0 to many Object2
Object 2 may have one and only object 1

I try this query: 
     Select id, name,(Select id,Total_Parcels_Forecast__c,Stage__c, Total_Revenues_Forecast__c, Domestic_Parcels_Forecast__c,Domestic_Revenues_Forecast__r,International_Parcels_Forecast__c from Tender_BU_Response__c) From Opportunity 

I have this error: 
Didn't understand relationship 'Tender_BU_Response__c' 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.
 
Shruti SShruti S
Could you please tell me which is the parent object and which is the child object?
Rahul.MishraRahul.Mishra
Hi,

Please try this:
 
Select id, name,(Select id,Total_Parcels_Forecast__c,Stage__c, Total_Revenues_Forecast__c, Domestic_Parcels_Forecast__c,Domestic_Revenues_Forecast__r,International_Parcels_Forecast__c from Tender_BU_Response__r) From Opportunity

Mark answer as solved if it does helps you.
 
Dev87Dev87
@Shruti Parent Object Opportuntity and Child object fromTender_BU_Response__C

@Rahul prob is not resolved.
Glyn Anderson (Slalom)Glyn Anderson (Slalom)
Default child relationship names are plural, so try "Tender_BU_Responses__r":

<pre>
SELECT  Id, Name, (SELECT  Id, Total_Parcels_Forecast__c, Stage__c, Total_Revenues_Forecast__c, Domestic_Parcels_Forecast__c, Domestic_Revenues_Forecast__r, International_Parcels_Forecast__c FROM Tender_BU_Responses__r) FROM Opportunity
</pre>
Dev87Dev87
Thanks for replay, 
Finaly I used  2 For loop because relation between objects are not Parent and Child Relation
Thanks