2 Replies Latest reply on Dec 11, 2014 8:52 AM by themactech.

    Disable Auto Enter Momentarily?

    themactech.

      Title

      Disable Auto Enter Momentarily?

      Post

      Hi everyone

      I have a table that has a field (not a key field) that auto generate a "control" number. I also have a script that runs and creates new records in the table but some of the records need to have the same "control" number. It works through a serials of variables and set fields, new record requests, etc. But I noticed that the control number skips ahead by 3 when the script is done. (100, 103, 106, 109, etc). I know it's doing this because in the middle of the script it's creating new records which auto generates a new number but through my set fields it replaces some of those numbers. So it's not really malfunctioning, it's just doing what I've told it to do. Is there a way to perhaps momentarily disable the auto-generate mid script? Or am I looking at a different way of generating these control numbers?

      thanks

        • 1. Re: Disable Auto Enter Momentarily?
          schamblee

          I wouldn't use a serial generated field because you can not modify the next number from script or disable the auto generate from script.  I would create my own field to hold the next number and then set this field by script as needed, which then populates your control number field. 

          • 2. Re: Disable Auto Enter Momentarily?
            themactech.

            Thanks.. what I ended up doing was create the beginnings of a Preferences Table. Created my starting Control Number field there... and then through the script I have running it goes through and sets the fields with that control number and another calculation increases the number by +1

            My control number looks like this FCR2014-0001 so I decided to use the SerialIncrement function to keep text intact. ;)

            SerialIncrement(text;IncrementBy)

            works for me. :)