Unanswered: Avoiding duplicate record error when manipulating primary key
I have a table say TEST_TABLE with columns TEST_PK and TEST_DATA(TEST_PK being primary key).
I make a data block in oracle forms for this table and provide the functionality in which user can manipulate the TEST_PK i.e
State-1 of displayed data block on form
State_2 of displayed data block on form
Now when i commit this form i get the error which basically suggests that there are duplicate records.
What i think is this to save the form in State_2 system tried to save '2' but in second record/row there was already a '2' due to which i got error. Am i right? If yes how can I tackle this situation??? I hope i'm able to convey the problem
down on the cube farm, left then right then another left
You are correct in your assessment of what is causing the error
I am not sure if you are talking about having two blocks both displaying the record or 1. Please clarify.
Forms is smart enough to know if you created a new record or if you are updating an old record. (that is why I question how many blocks you are using). I am wondering if you are messing around with the "set_record_property" values. Are you for some reason setting the record to be "NEW"?
Standard Forms functionality should allow you to create a record in a block (RECORD property = NEW), save it, upate a column (RECORD property = UPDATE), and save it without error. I would suggest you start over with your form. Use the wizards and create a basic form on the table. Run it and follow the steps I outlined.