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
hari0853701703454959hari0853701703454959 

Soql Query Using two objects

I have two objects one is custom object (i.e.., bookingrequest__c)and another one is Account object.In Account object i have 6 customfields.How to access that 6fields in custom object using soql query.
sachin kadian 5sachin kadian 5
Your question is not clear who you actually want to do.. I account is parent object of that custom object than you can easily do it. If you want same fields value of custom object , you can create formula field . You can also right the trigger to get the values from parent object. 
hari0853701703454959hari0853701703454959
Account is parent object of that custom object.so,how to query the fields.
ericmonteericmonte
So if you have a custom object called bookingrequest__c and it has a lookup relationship to acccount, are you trying to query fields from the Account record? 

If you are you can just do the following

Select  Id, Account__r.fieldname from bookingrequest__c

Also this is the documentation you can refer to for SOQL Relationships: 
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_understanding.htm

Cheers