cancel
Showing results for 
Search instead for 
Did you mean: 

Update data from table of node

Former Member
0 Kudos

Hi,

I have the below scenario:

1. A table is binded to my node in editable mode.

2. There is an option of adding/deleting new records/rows in the table.

3. Now, whenever there is an action - Add/Delete, it has to be updated in Infotype on click of Save button.

4. User can add upto 100 rows of data.

Whenever the new data is entered, we have to update that in the infotype, and when there is a deletion, we have to delete the same from infotype.

Question:

How do I match which record has been added/deleted? Should I create a new node of same type and set it with Initial data, and do the comparison later when the user has modified the table? If yes, this will be a huge loop of comparing and infotype will be updated at every loop, considering the addition/deletion.

please suggest if there is a better way to do it?

thanks in advance

prateek

Accepted Solutions (0)

Answers (1)

Answers (1)

amy_king
Active Contributor
0 Kudos

Hi Prateek,

When you add a row to the table or delete a row from the table, you could keep track of the addition or deletion in separate context nodes, say node_add and node_delete.

Alternatively, instead of tracking the changes using context nodes, when you are ready to save you could just read from the database and compare those records to your node. Any records in the database that are not in your node are records that need to be deleted from the database. Any records not in the database that are in your node are records that need to be added to the database.

Cheers,

Amy