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
Sumant KuchipudiSumant Kuchipudi 

How can I pull parent's another child record field.

Hi, 
I have a Custom object (Transaction) which has Lookup(Account) field and in Contact object I have a custom field (ABC_internal_id). I need to access ABC_internal_id field with the SOQL query on Transaction object (by transaction ID). It might be a simple question but please let me get the clue. 
RKSalesforceRKSalesforce
your account may have multiple contacts associated with it
Raj VakatiRaj Vakati
Hi Sumant , 

Get the Transaction__c    object account  id 

Transaction__c   t = [Select Id,Account__c  from Transaction__c  ] ; 

You may get more than one contacts for each account . so use this query 


List<Contact> con =[Select Id ,ABC_internal_id from Contact where accountId =t.Account__c] ; 


 
Sumant KuchipudiSumant Kuchipudi
I got answer for this, thanks for your replies