How to insert attribute data in other entity attribute

I have 2 entities named Example entity and Invoice Entity:

i inserted all data in invoice entity from the example entity, so now all the record is same in both entities.

Now, i updated some records, i mean changed some values of a Amount Attribute from the Example Entity and added few more rows in it.

I wanted to update that values of amount attribute in the Invoice entity also, but without changing other attributes values, and i want to add that new rows also, how can i do that ????

Please help!!!


You can do this:

1. Read the corresponding Invoice record

2. Assign Examples's attribute values to that Invoice record

3. CreateorUpdate the Invoice Entity

that's it

Hi Dev,

you should have an attribute on Invoice entity linking to Example entity (sharing the same PK is the ideal or adding a FK to Example entity on Invoice entity (ExampleId).

To add the missing rows, it's easy, you can query Example entity and check if the record already exists in Invoice entity, if not, Create it.

To update the changed values you would have to do it at the same time as you update Example entity.

Or you can add new attributes to Example entity, flagging which attributes where changed... There a lot of ways to do it but require more entities/attributes/logic.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.