5 Replies Latest reply on Mar 30, 2009 8:05 AM by TSGal

    Upgrading from FM 6 to FM 10 - is there a change in Get(RecordID) function?

    tpayton

      Title

      Upgrading from FM 6 to FM 10 - is there a change in Get(RecordID) function?

      Post

      Just updated a monster database from FM6 to FM10. Got most of the kinks worked out but still having an issue with some applescripts related to the Get(RecordID) function:

       

      I have a table with about 3500 records. Here is what is happening:

       

      FM6 - Get(RecordID) on the last record in the database = 36834

      FM10 -  Get(RecordID) on a newly created record in the database = 4219

       

      Does anyone know if this function has changed in FM10? Because of it some AppleScripts are not working on newly created records.

       

      Thanks,

       

      - T. 

        • 1. Re: Upgrading from FM 6 to FM 10 - is there a change in Get(RecordID) function?
          TSGal

          tpayton:

           

          Thank you for your post.

           

          Actually, this was changed in FileMaker Pro 7.  One of our Knowledge Base articles (#703) talks about why this was changed.

           

          http://filemaker.custhelp.com/cgi-bin/filemaker.cfg/php/enduser/std_adp.php?p_faqid=703

           

          Let me know if you have any additional questions.

           

          TSGal

          FileMaker, Inc. 

          • 2. Re: Upgrading from FM 6 to FM 10 - is there a change in Get(RecordID) function?
            tpayton
              

            TSGal - Thanks!

             

            So now my problem is that I have some AppleScripts that reference the record_id, but it only works with the "old" record_id.  Here is a bit of the script (with an old script number):

             

             

            set fm_record_id to "36639"

             

            -- now that we have the record id all other variables can be grabbed from FileMaker.

             

            if fm_record_id = "" then display dialog "Can't get the correct data from filemaker. Good times."

            tell application "FileMaker Pro"

            activate

            tell database "HC Approvals"

            go to record ID fm_record_id

            set approval_number to cell "approval_serial_num" of record ID fm_record_id

            set client_code to cell "c_client_folder_code" of record ID fm_record_id

            set job_number to cell "c_job_number" of record ID fm_record_id

            set web_approval_path to cell "c_server_client_directory" of record ID fm_record_id

             

            end tell

            end tell 

             

            I can't find any new documentation on any AppleEvent changes to FM7 (or FM10 for that matter) on how to pull the "new" record_id.

             

            Thoughts?

             

            - T. 

             

            • 3. Re: Upgrading from FM 6 to FM 10 - is there a change in Get(RecordID) function?
              TSGal

              tpayton:

               

              To get the old record ID and the new record ID, run a script in both FileMaker Pro 6 and FileMaker Pro 10.

               

              1. Create two new text fields:

               

              Record ID 6 (Text)

              Record ID 10 (Text)

               

              2. Create the following script, "Record ID", in FileMaker Pro 6:

               

              Go to Layout [ <layout with Record ID 6 field> ] 

              Show All Records

              Unsort

              Go to Record/Request/Page [First]

              Loop

                 Set Field [ "Record ID 6" , "Status(CurrentRecordID) " ]

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

              End Loop

               

              --------

              (This will enter the Record ID for every record into the Record ID 6 field)

               

              3. Execute the script.

               

              4. Quit FileMaker Pro 6, launch FileMaker Pro 10 and convert the file.

               

              5. After the conversion, change the script "Record ID" to the following:

               

               

              Go to Layout [ <layout with Record ID 6 field> ] 

              Show All Records

              Unsort

              Go to Record/Request/Page [First]

              Loop

                 Set Field [ "Record ID 10" ; Get (RecordID) ]

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

              End Loop

               

              -----------

              (Note: the only change would be the Set Field command to change the field to be Record ID 10 instead of Record ID 6)

               

               

              6. Run the script.

               

              Now, you have entries for the ID values in 6 and the ID values in 10.  You should be able to cross-reference now.

               

               

              TSGal

              FileMaker, Inc. 

               

              • 4. Re: Upgrading from FM 6 to FM 10 - is there a change in Get(RecordID) function?
                tpayton
                  

                TSGal - thanks for that, but perhaps I miscommunicated.

                 

                The issue is I need to have AppleScript find a specific record. The Record ID in an AppleScript is apparently pulling the old "Record ID 6" even in FM 10 (which is crazy).

                 

                So do you know anyway I can either have FileMaker find out the FM6 Record ID, or an alternative way for AppleScript to find a specific record?

                 

                Thanks,

                 

                - T. 

                • 5. Re: Upgrading from FM 6 to FM 10 - is there a change in Get(RecordID) function?
                  TSGal

                  tpayton:

                   

                  I'm not familiar with the inner workings of Applescript.

                   

                  Anybody else out there with Applescript knowledge that can help?

                   

                  TSGal

                  FileMaker, Inc.