Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I query records from a related parent object?

object parent query records
0
Posted

How do I query records from a related parent object?

0

You can query parent records using relationship.field dot notation and have the query results displayed in one, simple table for browser viewing or CSV export. For example, to get your Contact’s Account Name, First Name, Last Name, and Owner’s Name, write your SOQL query like this: SELECT Account.Name, LastName, FirstName, Owner.Name FROM Contact Just remember to use the relationship names (“Account” and “Owner” in this case) to traverse the hierarchy up to five levels separated by dots. These names can be found under in the sub-folders of the fields on the Describe tab.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123