3 Replies Latest reply on Jun 10, 2009 11:51 AM by philmodjunk

    Creating Serial number for old database

    jimmelo

      Title

      Creating Serial number for old database

      Post

      Hello everyone, this seems like something I should have been able to figure out by now, but so far I have had no success and I haven't been able to find a usefull answer by searching.  Sorry if this is a real basic question.

       

      We have a FM database that my company has been using for years, prior to my arrival.  So we have well over 7K records that all ready exist.  I am trying to extend the functionality of the database and I need to create a matter ID field for each file that is all ready in existence and for all the new files that are created afterwards.  I know how to make it work for all the new records but how do I write the script for the old records???

       

      For now I have that field modifiable but once I populate my current records with a serial number I would make that field unmodifiable, unique and a serial value that would be entered upon commit.  This really seems like it should be easy. 

       

       

       Enter Browse Mode[]

      Go to Layout  ["Firm" (Client Page)]

      Show All Records

      Sort Records [Restore]

      Go to Record/REquest/Page [First]

      Set Next Serial Value [Firm::Client ID] <--- I also had Insert Text "1")

      Loop

         Go to Record/Request/Page [Next; Exit after last]

         Set Next Serial Value [Firm::Client ID]  

      End Loop

       

         

        • 1. Re: Creating Serial number for old database
          pamaj
             You really don't need to write a script at all.  Click into the field in question, and then go to Records -> Replace Field Contents.  You can specify a serial number (middle option), and there's a checkbox at the end of that option to update the serial number in entry options so that the next value is updated in your field definitions.  If you have over 7K+ (and counting) records, obviously I'd suggest shutting everyone else out in order to make the changes, because it's going to take a little while, and you wouldn't want anyone creating new records in the meantime.
          • 2. Re: Creating Serial number for old database
            jimmelo
               My god that was easy.  Thank you for saving my wall (from my head)!
            • 3. Re: Creating Serial number for old database
              philmodjunk
                

              Use Replace Field Contents with extreme caution on networked files. If another user is editing one of the records you want to modify with this tool, the record is "locked" and it will not be changed. You then get a message telling you how many locked records were skipped and have to try to figure out which ones didn't get modified :smileysad:

               

              I never use this tool unless I am absolutely sure that no other user can lock one the records I'm updating. That sometimes requires running it in a script after hours or taking the field down off the server long enough to run the update.