Options

Replace existing record

I have a table with 2 fields in the key. I would like to receive a confirm dialog if i try to input data in a Card of a record that already exists with that key, to choose if i want to replace it or not. However when i input a key that already exists, NAV has it's own error that says there is such a record. Is there a way to supress this error or somehow do it so i can:
-Input data in a Card
-Press OK
-If NAV sees, that a record with such a key already exists, it asks me if i want to replace it

any help greatly appreciated

Best Answer

  • Options
    lightninglightning Member Posts: 15
    Answer ✓
    Solved it with delayed insert, now i can check my own conditions before inserting a whole record including duplicate primary key

Answers

  • Options
    JuhlJuhl Member Posts: 724
    I don't have a solution, as I have never had the need.
    But I would start out with not working directly in the table. So maybe make a extra card for creation, and bind that to a temp table, and the put your logic in that card.

    But the reason for not having had the need, is that it doesn't really make sense.
    If the record exist, then the primary key is already in place and you can just change the other fields, or create a action that clears all the fields.
    Follow me on my blog juhl.blog
  • Options
    lightninglightning Member Posts: 15
    Answer ✓
    Solved it with delayed insert, now i can check my own conditions before inserting a whole record including duplicate primary key
Sign In or Register to comment.