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
amrutha kommuriamrutha kommuri 

update child record based on other child records

I have a Contact(Parent) and Prorgam Enrollment(Child). 

A contact can have multiple Program Enrollments. There is a date field on the Program Enrollment. 
For example, If a contact has 4 Program Enrollments and if I update the date field in One Program Enrollment, the same date should be updated in the other program enrollments too?? 

Can I achieve this through workflow rules? or process builder with out any code?


I appreciate your time and Help!
Suresh Kumar Arjunan1Suresh Kumar Arjunan1
Yes, try using process builder.

Whenver change in date field, invoke process builder.

1) In the action section, choose "Update Records"
2) Record Type, choose program enrollment's parent. In your context, Contact Object. Within contact object, select all program enrollment records. Like, [Program_Enrollment__c].Contact.Program_Enrollment__r.
3) Criteria for updating records, choose "Updated recrods meet all conditions"
4) Select ID Doesn't equal to Current Object Id. AND Contact Id equal to parent ID.
5) Select field values to update and SAVE.

Hope this helps!!!
amrutha kommuriamrutha kommuri
Thank you Suresh. That helped to some extent. But how do I update the date field with value in the same field but on other Program enrollments??
Suresh Kumar Arjunan1Suresh Kumar Arjunan1
5) When you select the field to be updated. You have to give current record's date field value from program enrollment object.
amrutha kommuriamrutha kommuri
I received the following error:

RECORD UPDATE: myRule_1_A1
Find all Program_Instance_Attended__c records where:
Referred_by__c Equals {!myVariable_current.Contact__c} (0030B00001wAdFVQA0)
Contact__c Equals Id
Id Does not equal Id
Update the records’ field values.
Core_Training_Start_Date__c = {!formula_2_myRule_1_A1_8760513816} (August 23, 2017)
Result
Failed to update records that meet the filter criteria.
Prajakta Sawardekar 3Prajakta Sawardekar 3
Hi Amrutha,

You can do this with Process builder.
1. Write PB on Prorgam Enrollment.
2. Define the criteria 
3.  In the action section, choose "Update Records"
4. For a Record Type select Prorgam Enrollment >> Contact >> Prorgam Enrollment(__r for custom object)
5. Set the value to update records
Miranda L 2Miranda L 2
Hello Suresh,
I have the same scenario but in my case I want to get value from Multi Picklist so I am trying but I am not getting it.
Here is my screen shot
User-added image
I have CSM Child object of Account. Also I have Master Detail relationship with CSM and Account. I want to populate value from Opportunity to CSM object.
Could you please help me in PB or formula field.
Thanks