2 Replies Latest reply on Jun 11, 2010 8:07 AM by Frinholp

    Auto-generated serials



      Auto-generated serials


      OK I have requested help previously regarding this problem and I marked the post as solved so I thought it is best to start a new thread. Here is the old post:




      I currently have my RecordID field created by calculation which is based on an auto-generated serial number. For consistency I would prefer to have all ID fileds sequential. Previously I had my ID's auto-entered on creation. The problem was that if I decided not to commit a record, a serial had  been generated leaving inconsistency in my calculated ID's. To get around this problem instead of having the serial generated on creation, I changed it to be generated on commit. This presented a new problem. I have a situation where a record creates a record in a related table through a portal. I need an ID to use as a foreign key for the record created through the portal. If my ID's are created on commit, there is no ID to pass to the record in the portal.


      Has anyone any ideas how I can get around this problem? It would be nice if I could generate the ID's on creation and if say a cancel button is pressed, I  write a script that reverts the record and decrements the serial generator value by one. Is this possible?


      I hope my problem is clear, if not please ask for more info.


      Thanks in advance



        • 1. Re: Auto-generated serials

          the solution could be, to use the auto-generated serial for recordID, as you already do, and a second on commit generated number for your record as "visual ID".


          greetings from germany


          • 2. Re: Auto-generated serials

            Thanks for the response Chris. I could do that but I've just found a function called Set Next Serial Value.


            I have a field called Seria# which is an auto-generated serial on record creation, and a field called RecordID whose value is auto-entered by means of a calculation using the Serial#. I have created a cancel button that triggers a script that  Sets Next Serial Value [table::Serial#; table::Serial#] then reverts the record.  This seems to have done the trick.