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

How get a Value of a field in a InnerJoin SOQL?
Hi,
I'm trying to get a child field with SOQL, but I not have success.
I must get the fields of Object Account and Object Product_Account (Child of Account).
I write A query like this:
LIST<Account> accounts = [SELECT Account.Name, (SELECT Product_Account__c.Status__c FROM Product_Account __r) FROM Account];
for(Account account : accounts){
System.debug('Account Name: ' + account.Name + ', Product Name: '+ HERE I WANT GET THE VALUE FROM "Product_Account__c.Status__c" FIELD);
}
Is it possible to do?
Thanks
Rafael
I'm trying to get a child field with SOQL, but I not have success.
I must get the fields of Object Account and Object Product_Account (Child of Account).
I write A query like this:
LIST<Account> accounts = [SELECT Account.Name, (SELECT Product_Account__c.Status__c FROM Product_Account __r) FROM Account];
for(Account account : accounts){
System.debug('Account Name: ' + account.Name + ', Product Name: '+ HERE I WANT GET THE VALUE FROM "Product_Account__c.Status__c" FIELD);
}
Is it possible to do?
Thanks
Rafael
Let us know if this will help you
All Answers
for (Account p : [SELECT Id, Name, (SELECT Id, Name, Status__c FROM Product_Accounts__r) FROM Account])
{
//process this
}
Let us know if this will help you
Thanks, it's work.