Add existing entities to a collection
How do you add an existing entity record to an entity collection?
We have an Invoice master entity, which is a process entity in process A. There's another master entity called PreparedInvoices. This is a process entity in process B. PreparedInvoices has a 1 to many relationship via collection to the Invoices entity, so 1 PreparedInvoices may contain many Invoices. So at this point process A created a lot of Invoices, but we have no PreparedInvoices so far . Now, I would like to show some of the Invoices in process B in a table. The idea is to have the PreparedInvoices entity and dynamically add the Invoices that I want (based on some filters) to the collection to the PreparedInvoices. So, how do you do that without manually copying each attribute to a new collection item ? And yes, it would be nice that if the Invoice object gets modified, it is reflected in the Invoice collection of the PreparedInvoices. So no copy, but reference.
Thank you in advance!