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
Chetna Agrawal 12Chetna Agrawal 12 

copy value from parent field to child while creating child record

this schenario only meet when i select 1 record type
i am trying this by using process builder but failed.
do we only achieve this by trigger?
SYED MOOSA NAZIR T NSYED MOOSA NAZIR T N

The simple and best way to address this scenario is FORMULA FIELD in CHILD OBJECT.

Lets say you have two Record Types - "A" and "B".
You want to copy value from Parent record field, only if the Record belongs to record type "A" and you dont want to copy value if the record belongs to record type "B".

In Formula, You have to specify,
IF the Record Type is "A", then ChildObject.ChildObjectField = ParentObject.ParentObjectField
ELSE ChildObject.ChildObjectField = ""

Hope the above approach address your query. Please let us know if this will help you
Thanks
Syed Moosa Nazir TN
smartmoosa@gmail.com

 

Chetna Agrawal 12Chetna Agrawal 12
Thanks for solution,
but i don't want field to be formula type, my fields are of type number,text etc.
Chetna Agrawal 12Chetna Agrawal 12
This can be achieve through workflow rule-field update.
Sumit Kumar Singh 9Sumit Kumar Singh 9
Hello Chetna,
Can you pls explain me, how?
As far as I know, only detail - to - master field update is possible using workflow, but the reverse is not possible.
Chetna Agrawal 12Chetna Agrawal 12
I have 2 two objects Test1 (Parent) and Test2(Child).
Test2 is having 2 record types say 'New' and 'old'.
workflow is on Test2, Evaluation Criteria is when a record is created and Rule criteria is Record type equal to  'New'.
Now in field update, i am updating field say 'Rating'.
and use a formula to update it, which put parent's rating field value into this field. and check 'Re-evaluate Workflow Rules after Field Change'.
Sumit Kumar Singh 9Sumit Kumar Singh 9
Wow! mark your answer as best answer.
But, I have one more question over here - "
"Re-evaluate Workflow Rules after Field Change"  why ?? Do you think the worflow will be re-evaluated as the "Evaluation Criteria is when a record is created" ?

Thanks, 
Sumit Kumar Singh
 
Chetna Agrawal 12Chetna Agrawal 12
sorry it will not run when Evaluation Criteria is 'created', it need to be 'created, and every time it’s edited'
Sumit Kumar Singh 9Sumit Kumar Singh 9
Hello Chetna, 

This approach will have problem of "data consistency".
What will happen if - 

A parent record is updated which is already having some child records. Will the change be reflected to all childs records?? I don't think so as the workflow is on child object.


Thanks,
Sumit Kumar Singh


 
Chetna Agrawal 12Chetna Agrawal 12
This workflow is on child object which only copy field value from parent to its field but i will not reflect value while parent update its same field.
to achieve this we have to build a process by using process builder on parent object.
using process, change will be reflected on all childs.
Sumit Kumar Singh 9Sumit Kumar Singh 9
Hello Chetna, 

Got it!
If you acheive this using workflow and process, then you should mark your answer as best answer, as it may help others.

Thanks,
Sumit Kumar Singh
MinnuSFMinnuSF
Hi i have more than 20 fields to update same values from parent to child whien i choose lookup from child what is the best way ? 1, formula , workflow, trigger
Linda ThompsonLinda Thompson
The solution described above sounds like what I need but your instructions are too vague for me to follow.  Can you please provide an actual example of the formula?  I am trying to update the Stage field on a TASK if the TASK's parent is an opportunity.  The Stage field is on both the Opportunity and Task.  I want the task to be populated with the Stage value from the (parent) opportunity at the time the task is created.  Your help would be much appreciated!