I created a form that allows users to dynamically add as many fields as needed. Each of them is an inventory item assigned to a device. I have 3 tables, Devices, Inventory Elements, and a third to associate a device with an inventory element.
When the user saves the form, it is possible that they deleted existing records, added new ones or left unchanged. The best way I can think of is to clear all the rows of the table that associate this device with the element and rewrite them based on input from the form.
Would there be a more efficient way to do this? I cannot imagine that dropping all the lines and then rewriting them is the most viable option.
user470760
source share