struggling with Add or Edit

I have a table that's got a unique key on 2 fields, 'book_id' and 'part'

there's also the unique key of the table, id

i tried multiple ways of add/edit, try {add} else {edit} and doing a lookup of the id first and if blank, adding, if not, edit, and the problem seems to be that if i try to edit an existing record, because i need to specify several parameters, it fails to update and gives 'duplicate record' errors. This is on an edit, not an add.

The fact that Get Record only takes one parameter is a problem for me, and Edit Record expects only 1 parameter instead of the 2 I need to use is really causing me a headache.

Is there some documented path or video on how you manage to update records when you have a multi-parameter unique index?

This logic should work except I can only look up a record for Edit based on one field? That's just incredibly limiting. What is the right path forward?

The image shows what happens if you try to write a new 'answer' to the database when 'part' and 'book_id' both already have an entry.

2 replies