6 Replies Latest reply on Mar 24, 2011 1:25 PM by CraigFiore

    Finding Records



      Finding Records



      Is there a GET function that will tell me the current record number I am in? I tried Get(RecordID) and Get(RecordNumber) but they did not work.

        • 1. Re: Finding Records

          In what context are you using these?

          Get ( RecordNumber ) returns the position of the current record in the current found set.

          Get ( RecordID ) returns an internal serial number that uniquely identifies each record. Unlike a serial number field, it cannot be changed expect by importing the records in to a new table, the imported records automtically get new record ID's in the order in which they are imported.

          Get ( RecordNumber ) probably reports the correct number in a calculation field only if the calculation field is unstored.

          • 2. Re: Finding Records

            I created a field called RecordNumber. It is a calculation field with GET(RecordNumber)in it. For example if I am in record #2 out of 3 of an unsorted set, the RecordNumber field says 13.

            In a script I have with "Go To Record". I am want to  "Set Variable" to save the current record and later in the script I use "Go To Record" to go back to it.

            • 3. Re: Finding Records

              But is the calculation field an Unstored calculation field?

              In any case, you don't need the calculation field to save the current record number

              Set variable [$RecNo ; value: get ( RecordNumber ) ]

              Just keep in mind that the record number will change if you modify the found set in any way, by sorting in a different order or by performing a find to name just two examples.

              • 4. Re: Finding Records

                The only way I will modify the set is by Duplicating one of records and that always goes to the end. Will this still change the numbering?

                • 5. Re: Finding Records

                  Not true. If this is your unstored calculation:

                  Get (RecordNumber)

                  It will return the position of the record in your current found set. It will update each time you modify the found set in a way that changes it's position in that order.

                  If the field is stored, it will record the order at the time the record is created and will then not update.

                  • 6. Re: Finding Records

                    Thanks, I will have to re-right the script.