+ Start a Discussion
HunnyHunny 

Soql to retrive account field in custom object

Hi,
In my Case the senarios is there is custom Object (investment) lookup with contact. In Custom Object when status field is update i have to update account field. 
To make that thing possible i have to query account field in custom object trigger but i am not able to fetch accounts field.
Can please someone help how do i do that.

Thanks 
PR
AshishkAshishk
You can do query like:-

Assuming contact lookup field api name is Contact__c.

obj=[Select id, contact__r.Account.Name from investment];

Just add field in query lke contact__r.Account.fieldapi name, it will work.