Announcement

Collapse
No announcement yet.

Add New Record from Form does not correctly create next Auto Increment ID

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

  • Add New Record from Form does not correctly create next Auto Increment ID

    Starting to use scriptcase with a sample MySQL database. Have a table with approx 28K rows and have and ID field which is auto-increment.

    If I use SQL browser to insert new record the next ID field is correctly generated but if I use Add New from form the ID field is always set to 0.

    Any clues?

  • #2
    Do you have set the field in the field settings as autoincrement? Besides that, if you insert new record in scriptcase which is not stored in the database yet, then the keyfield will not contain the next index number. MySQL will generate that on commit. So you need ot apply the update first.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      Many thanks Albert, guided me through solution with your feedback. I'm starting to love ScriptCase!

      Comment


      • #4
        Originally posted by aducom View Post
        Do you have set the field in the field settings as autoincrement? Besides that, if you insert new record in scriptcase which is not stored in the database yet, then the keyfield will not contain the next index number. MySQL will generate that on commit. So you need to apply the update first.
        What to do if I want the id to appear before comit?

        Comment


        • #5
          Originally posted by michael View Post
          What to do if I want the id to appear before comit?
          Then you should think about your database design ... Please explain, why you want the id before commit. At least this is uncommon and is usually a design problem.
          Best regards: - Reinhard -

          I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

          Comment


          • #6
            My customer gets a code with year + his serial number, ... so wanted it to appear on the form .... But have already managed to do it with onLoad.

            Thanks for advice.

            Comment

            Working...
            X