[SalesForce] export related fields using a data loader

I want to be able to export the related account fields for each quotation in Salesforce using Data Loader. I suspect this is possible using relationships (Object__r.FieldName__c), but I'm not 100% sure. If it is possible, can you explain how?

Best Answer

You can export parent and their parent attribute values from Child object.

But from the parent, you cannot export child object related attributes.

You could move to 5 levels up to the Parent or related objects.

As we cannot query foreign key relationships more than 5 levels away from the root SObject

so, maximum up to this level is supported from Quote:

Opportunity.Account.Parent.Parent.Parent.Name

In the below example I have shown how to move from

Quote --> Opportunity --> Parent Account --> Parent.Parent.Account

Example

SELECT Id, Name, 
    OpportunityId, 
    Opportunity.Name, 
    Opportunity.Account.Name, 
    Opportunity.Account.Id, 
    Opportunity.Account.ParentId, 
    Opportunity.Account.Parent.Name
FROM Quote

Results

hierarchy