You need to sign in to do that
Don't have an account?
NagSha
Didn't understand relationship 't.Test__r a' in FROM part of query call.
i have two custom objects parent: test,child:Application
i want to send all test object fields for that specific application.,
The query i have
lsttest =[Select (Select a.English_Writing_Score__c,a.English_Score__c,a.Math_Score__c,a.Reading_Score__c,a.Science_Score__c,a.Composite_Score__c,a.exportSequence__c,a.Other_Score__c,a.SAT_II_Subject__c,a.SAT_II_Subject_Score__c,a.TOEFL_Speaking_Comprehension__c,a.TOEFL_Total_Score__c,a.TOEFL_Writing_Comprehension__c From t.Test__r a) from Application__c t Where Id In :lstids];
the test__r is how it's called on apex code the test__c lookup field on your application__c object.
basically this query is taking for every application the related test.
Hi.,
To be clear.,
I have a application field in test object that has lookup relation to application.,
yes i need to query all the test scores available for that application.,
i tried doing that way but still has the error.,
Here is simple objects to get point which i am missing.,
public class test1{
public static void samplemethod(list<id> lstcust){
List<Sample1__c> sam1 = new List<sample1__C>();
sam1 = [Select (select city__c,number__c from a.test__r) from Sample1__C a where id in: lstcust ];
System.debug('================print========'+sam1);
}
}
ok if so...it seems that you dont need any field from sam 1 so why dont you try just to query like this:
public class test1{
public static void samplemethod(list<id> lstcust){
List<Sample1__c> sam1 = new List<sample1__C>();
sam1 = [select city__c,number__c from Sample1__C a where id in: lstcust ];
System.debug('================print========'+sam1);
}
}
and as I told you using the __r like that will throw an exception.......
lsttest =[Select a.English_Writing_Score__c,a.English_Score__c,a.Math_Score__c,a.Reading_Score__c,a.Science_Score__c,a.Composite_Score__c,a.exportSequence__c,a.Other_Score__c,a.SAT_II_Subject__c,a.SAT_II_Subject_Score__c,a.TOEFL_Speaking_Comprehension__c,a.TOEFL_Total_Score__c,a.TOEFL_Writing_Comprehension__c from Application__c t Where Id In :lstids];
contact---> account;test----->sample1
i need to send all thefields of tests associated with sample1 object (like all contacts for account)
problem solved.,
used eclipse ide to grab them..,