Announcement

Collapse
No announcement yet.

Form: cannot update field part of unique key

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Form: cannot update field part of unique key

    I have a table named STOCKID, which list products of several season.
    Primary key is composed by the two columns Stockid and Season (same stockid could exist for different seasons).

    I built a single record form for this table, defining unique key as made of Stockid and Season (this causes the following issue I guess).
    The field Stockid has to be updatable.
    Whenever I modify the Stockid field , and press the update button, I receive an error message, stating "error updating to the database. No row found".
    How is it possible to make the Stockid updatable ? I guess it has to be part of unique key ...

    PS: as far as the sql is concerned. The (stockid, Season) is part of a foreign key relationship (on update cascade) with a table orders (stockid,season). Via sql I can modify the stockid field and the update propagates correctly to any related order . I have problem with scriptcase, not with sql.

    Thanks in advance
    Last edited by federico.maccioni; 02-24-2016, 07:37 AM.

  • #2

    I have same problem, primary key made by two fields, I need to let change the second one, but get same error, I guess because the page ha only the "new values", so before the UPDATE system try to test if the record exists but, obviously it doesn't, the system have to remember the original values, at least for key fields, use original fields for checks and the run the update with the new values.

    Let's see if SC staff have an answer bout it.

    thanks

    Comment


    • #3
      Did you find a solution/fix for this? I have the same problem....Thanks!

      Comment


      • #4
        Solved with modification on the table structure.
        Added a PK identity field (leaving unique key on the original fields).
        Removed uniqueness on scriptcase.

        This way update works.
        Last edited by federico.maccioni; 02-24-2016, 07:36 AM.

        Comment

        Working...
        X