You need to sign in to do that
Don't have an account?

Trigger to copy field from parent to child
HI Developers,
I need A trigger to copy the value of a parent field to a child field. My parent object is Delivery__c, the child object is ItemDestributed__c
The parent child called Status__c and the child field called DelStatus__c. I need that these 2 field have same values all the time.
I need A trigger to copy the value of a parent field to a child field. My parent object is Delivery__c, the child object is ItemDestributed__c
The parent child called Status__c and the child field called DelStatus__c. I need that these 2 field have same values all the time.
You are right. Your trigger should be ob after insert and after update. In your code null checks are important those you were missing. Because incase of after insert your Delivery may or May not have associated Distributed items.
Please find below code for the same. Hope this will work.
Please mark as best answer if helped.
Regards,
Ramakant
Regards,
Ramakant