Ask Search:
Pierre BoivinPierre Boivin 

Workflow field update formula to calculate the delta between two dates on related records - has to be first created record date

I have added a field on my custom object "Projets",

I want to display in this field the delta between current record created date (or other) and the related object "Impayés" first created record. "Impayés" has a lookup field to "Projets"

Happy to go at it with workflow or process builder, I just don't know how to select the related first created record

Best Answer chosen by Pierre Boivin
Steve MolisSteve Molis
If the objects have a Master-Detail Relationship you could do this automatically using a custom Roll-Up Summary (DateTime) Field and return the MIN (first) CreatedDate from the Child object records.  Then create a Formula field on the Master object record to do the math