5 Replies Latest reply on Jul 24, 2012 12:34 PM by philmodjunk

    How to transfer records to new table

    AnnetteVillarreal

      Title

      How to transfer records to new table

      Post

      I have a "status" field and I want to add option bottons. For example, when I input information, I want a "current" option. When it changes status, I want to move it to the "passed" table with a click of a bottom. I know how to export-import, but there must be an easier way. I've dipped into script making, but it doesn't make sense.

        • 1. Re: How to transfer records to new table
          philmodjunk

          The easiest way is to not move the records, keep them in the table where they are. Since you have a status field, find criteria, portal filters and many other features can control whether you see "current", "passed" or both types of records on a given layout.

          • 2. Re: How to transfer records to new table
            AnnetteVillarreal

            I would like to have seperate tables. Is that possible?

            • 3. Re: How to transfer records to new table
              philmodjunk

              It's possible, you've described one method for doing so already in your original post, but I strongly advise against it. The separate tables are likely to make your data much harder to work with.

              • 4. Re: How to transfer records to new table
                AnnetteVillarreal

                I would like the "passed" records in a seperate table and out of the way because they are no longer needed. Do you know how to create this function? I don't understand scripts at all.

                • 5. Re: How to transfer records to new table
                  philmodjunk

                  I just don't like to "help" people get into a situation that doesn't really help them. If you no longer need them, why not delete them? The obvious answer is that you might need them and thus want them in the other table, but then we end up "round the bush" with me suggesting that in such case you really don't need to move the records to another table.

                  If you don't understand scripting it will be difficult to help you as a script is best used to copy a single record from one table to another.

                  Let's assume you have a serial ID field in this table called "__pkPrimaryKey". If you have such a field, you can link your two tables like this:

                  currentRecords::__pkPrimaryKey = PassedRecords::__pkPrimaryKey

                  Then go to every field in PassedRecords except __pkPrimaryKey and use field options to specify a looked up value setting that copies data from the corresponding field in CurrentRecords.

                  Now all you need do is create a new record in PassedRecords and enter the value of CurrentRecors::__PrimaryKey and all the data from all the fields copies over into the new record from the CurrentRecord whose __PrimaryKey value was entered into that field.

                  Go back to the above relationship; double click the line connecting the two table occurrences and select "allow creation of records via this relationship" for PassedRecords.

                  Now you can use this two line script to move a record from CurrentRecords to PassedRecords:

                  Set Field [PassedRecords::__pkPrimaryKey ; currentRecords::__pkPrimaryKey]
                  Delete Record