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
Juan Miguel FranciaJuan Miguel Francia 

Trigger Accessing Records from a lookup of another Object

Now I have a `Matter__c` object that has a custom field called `Project_Name__c` which is a lookup to `Opportunity`. Now that `Opportunity` has a custom field called `RVM_Committed_Spend__c`. Now what I want to happen is to get the value of `RVM_Committed_Spend__c` and transfer it to the the newly created custom field in `Matter__c` called `RVM_Commited_Spend_Matter__c`

This is the only part I need so that I can finish my before Insert/before Update Trigger. Thank you in advance. Hoping you can answer my question.
ZhixunZhixun
if you want RVM_Commited_Spend_Matter__c to be read only, better set it as formula field, linking RVM_Committed_Spend__c to it.
 
UC InnovationUC Innovation
Hi Juan,

I'm not sure why zhixun got downvoted, but he is correct. Just create a formula field like this:
 
Project_Name__r.RVM_Committed_Spend__c

Hope that helps!