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
SteriCycleSteriCycle 

Date on one object auto-populated on another object

I built a custom object that has a date field.  Whenever the field is populated and the record is saved, I need to have that date automatically populated in a date field on the account object.  Does anyone know where I'd find the logic to build that?  I know I need a trigger, but our organization does not have any developers.

Pradeep_NavatarPradeep_Navatar

Yes, you can do this thing using trigger and workflow rule as well. In case of workflow rule you need to create relationship between these two objects. As you said that you doesn’t have any developer so workflow is the best choice.

FVinceFVince

As Pradeep said:  a workflow will work.

Use the function NOW () to update the field.

alulalul

Thank you.  Right now I have a lookup field to the account record.  I'm assuming that in order to create a workflow that updates another field on the account object that I would need to make the account record field on my custom object a master-detail?

FVinceFVince

I just double checked: you will need a trigger for this one. There is no way to update a master object field when another field from a related object is updated/changed.

Let me know if you need more help on this trigger.

alulalul

OK, that's what I thought.  I'm working with a co-worker on attemping to build this.  For some reason when I do a new force.com project in eclipse, it's not pulling through all of the fields on my custom object.  I'm going to log a case with developer support on this.  Any pointers or suggestions on how to build the trigger would be much appreciated.