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

How do I copy fields from one record to other?



I am building a custom object similar to case. What I want to do is copy fields (notes, reason code) from a case to other cases.


e.g. Customer service calls a client for a invoice payment follow-up(on existing case), the response from client(notes) could be same for other pending invoices. How do we copy these notes to other cases? I am trying to avoid parent-child objects (parent = case, child=pending invoices).




This cannot be accomplished with a workflow. You will need to develop a custom Trigger.


Apex Language Reference


Thank you.


But how do I relate all case's to update with the reference case? I mean visually?


Those updates could be done in a pretty basic Trigger.


If you don't mind me asking why do you want to avoid Parent-Child objects?


There are pending invoices which are followed-up, and many invoices can be assigned to a case(parent).  The client pays for few invoices attached to the case, so it would be difficult to unassigned the remaining pending invoices. If somehow we unassigned/de-link them - they will lose the follow-up history.