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

Soql to retrive account field in custom object

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.

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.