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
RoyaleDevRoyaleDev 

Update field on parent object based on date field on child object.

I have a date field on child object . receiveddate__c. I have a field on parent object mostrecentproductreceived__c. Is it possible to use workflow or process builder to update the mostrecentproductreceived__c field on parent based on the receiveddate__c. 

If there are two  child records , Record1 with  receiveddate__c = 11 May 2020 and Record2 with receiveddate__c = 1 May 2020. Then the mostrecentproductreceived__c should have the product from first record. 

if a new child record Record3 is added with receiveddate__c = 13 May 2020 then mostrecentproductreceived__c should be the product from this record. 

If Record1 is updated receiveddate__c = 14 May 2020 then mostrecentproductreceived__c should be the product from this record. 

How can I do this?
 
siri dellsiri dell
updating a record from child to parent is possible on process builder.

 create a processbuilder on child object
select the criteria:(based on ur requirement)
for example:
receiveddate__c ischanged value true.
then 
Add an Action type:update Records
record type:[mostrecentproductreceived__c]

feild type choose as refernce
 
Alan McQueenAlan McQueen
Or an after-save flow on the child object and compare the parent date < child date, then take action to update parent record if satisfied.