You need to sign in to do that
Don't have an account?

why my query doesn't return detail fields for my child custom object?
Hi,
We added a custom object called Analytics Group under Account. It is a list and I created one object manually under one account
When I run this query:
"SELECT id, name, Sage_ID__c,FCA_Number__c, Owner.Name,(SELECT Group_ID__c,Account_Limit__c,Concurrent_Limit__c,Display_Name__c,Expiry_Date__c,Notes__c,Version_Name__c,Version_ID__c FROM Analytics_Groups__r) FROM Account where id=xxxx"
I can see that the account does have one Analytics_Groups__r returned. But it is returned as a QueryResult, with two Fields "FieldsToNull" and "ID", and both fields are null. I asked those fields: Group_ID__c,Account_Limit__c,Concurrent_Limit__c,Display_Name__c,Expiry_Date__c,Notes__c,Version_Name__c,Version_ID__c
but none of them seem to be returned (or maybe I just don't know where to retrieve them)?
Can someone help?
We added a custom object called Analytics Group under Account. It is a list and I created one object manually under one account
When I run this query:
"SELECT id, name, Sage_ID__c,FCA_Number__c, Owner.Name,(SELECT Group_ID__c,Account_Limit__c,Concurrent_Limit__c,Display_Name__c,Expiry_Date__c,Notes__c,Version_Name__c,Version_ID__c FROM Analytics_Groups__r) FROM Account where id=xxxx"
I can see that the account does have one Analytics_Groups__r returned. But it is returned as a QueryResult, with two Fields "FieldsToNull" and "ID", and both fields are null. I asked those fields: Group_ID__c,Account_Limit__c,Concurrent_Limit__c,Display_Name__c,Expiry_Date__c,Notes__c,Version_Name__c,Version_ID__c
but none of them seem to be returned (or maybe I just don't know where to retrieve them)?
Can someone help?
Hi ,
Suppose you are using a list to store the query result blow code will be useful for you to get values.
List<Account> accList = new List<Account>(["SELECT id, name, Sage_ID__c,FCA_Number__c, Owner.Name,(SELECT Group_ID__c,Account_Limit__c,Concurrent_Limit__c,Display_Name__c,Expiry_Date__c,Notes__c,Version_Name__c,Version_ID__c FROM Analytics_Groups__r) FROM Account where id=xxxx"]);
Set<string> groupIds = new set<string>();
for(Account acc : accList){
for(Analytics_Groups__c ag: acc.Analytics_Groups__r){
groupIds.add(Group_ID__c);
}
}
You can change the code within the for loop as you required.
Regards,
BDatla
Looks like you were using partner wsdl, can i know from which platform were you trying to consume partner wsdl??
In case of java, below link might help you.,
https://help.salesforce.com/apex/HTViewSolution?id=000005452&language=en_US
Thanks,
Balaji C Garapati
under the Account class in the wsdl, it was:
public QueryResult Analytics_Groups__r
{
get {
return this.analytics_Groups__rField;
}
set {
this.analytics_Groups__rField = value;
this.RaisePropertyChanged("Analytics_Groups__r");
}
}
I need to manually modifiy it to:
public QueryResult<Analytics_Group__c> Analytics_Groups__r
{
get {
return this.analytics_Groups__rField;
}
set {
this.analytics_Groups__rField = value;
this.RaisePropertyChanged("Analytics_Groups__r");
}
}
Then the searilization works as expected.