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
Jem57Jem57 

Update a field based on 2 fields in other objects

Is something like this possible? I have 3 objects. 2 are related via lookup. I'd like to compare the value of a field in 2 of the objects (unrelated) and if it matches, pull a field from 1 of those objects to update into a 3rd object (that's also not related to the one I'm getting the data from)

So it would be something like this: 
If Account.field = User.field then set ObjectC.field=User.field2. 
Account and ObjectC are related to each other via a lookup. The user would be unrelated to the account or ObjectC(not an owner, etc). 
 
@login.ax974@login.ax974
Jem, to start with a trigger on Account can help. But depending on the data volume you might have to think of additional conditions to avoid running into governor limits.
Jem57Jem57
Wouldn't it be a trigger on ObjectC since that's what's getting updated?