Table based work instructions - deleting records

Hi Suraj,

If you are set on using a table based approach, setting a field to inactive has the advantage of never loosing the definition of the work instructions, and is probably a good solution to your current design. Since you need to have a management app to configure the work instruction, this app will keep the data tidy to the users (users should not have to see the entire database). It does require to modify your queries to use the new active/inactive field though, adding a bit more complexity to the app.

Why do you see the need in deleting those entries from the table?

Not knowing the design of your app, it is not clear what the best alternative solution might be (except for looking into a more composable design as recommended by Beth), however one solution that is often used it to use a Sequence field: it can be used to order the work instruction definitions, and help find the ID of the next one with a query/aggregation. This way let’s say you have 3 instructions with Sequence 5,6,7; when #6 is deleted, you can still retrieve the ID of #7 by looking the the next work instruction with Sequence higher than 5 (make sure to set Limit field to 1 as shown below)

Regards,
Seb