You need to sign in to do that
Don't have an account?
chim chim 9
Hi. I made a parent-child query, the thing is i want to call the child data from my query but i dont know the proper code to put
This is my query:
Account[] oldAcc = [Select Id, BillingStreet, (Select Id, AccountId, MailingStreet from Contacts)Name from Account Limit 10]
I tried using oldAcc.Contact but i got no values when i tried it using system debug.
Account[] oldAcc = [Select Id, BillingStreet, (Select Id, AccountId, MailingStreet from Contacts)Name from Account Limit 10]
I tried using oldAcc.Contact but i got no values when i tried it using system debug.
Exexute query from query editor as well to check whether Account has related contact or not
Select Id, BillingStreet, Name,(Select Id, AccountId, MailingStreet from Contacts) from Account Limit 10
If it helps ,Please mark it as best answer.
Thanks!
All Answers
I want to modify the Billing street from the queried Accounts and at the same time change the mailing street of the related contacts of each account
Exexute query from query editor as well to check whether Account has related contact or not
Select Id, BillingStreet, Name,(Select Id, AccountId, MailingStreet from Contacts) from Account Limit 10
If it helps ,Please mark it as best answer.
Thanks!