5 Replies Latest reply on Jul 19, 2012 3:05 PM by philmodjunk

    How to insert new record above existing

    AnnetteVillarreal

      Title

      How to insert new record above existing

      Post

      This should be an easy task, but I can't figure it out:

      I have a full list of records already made and I want to insert a new one on top of the rest, as you would in Excel. You can add a new record, but it goes to the bottom of the list and you can't drag and drop it to the top. How can I do this?

        • 1. Re: How to insert new record above existing
          philmodjunk

          What kind of List? A list or table view or a list of records in a portal?

          Either way, a sort order controls what record is listed first, second, third.... If the records are unsorted, they are listed in the order that they were created.

          You'll need to specify a sort order such that the most recently created record appears first in the found set.

          Say you have defined an ID field to auto-enter a serial number. The most recently created record will have the largest ID number. Thus, you could sort your records by the ID field in descending order and the newest record would be listed first. In a list or table view in Filemaker 11, once you have specified a sort order, new records and records where a value affecting it's position in the sort order has been changed automatically move to the posittion in the found set dictated by this sort order. In FileMaker 12, they added the ability to disable this feature as it often confuses users. There's a check box: "keep records in sorted order" you'll need to be sure to enable for this trick to work.

          Much of this is also true for a portal, but the sort order for records in a portal may be set in portal setup or in the relationship on which the portal is based.

          • 2. Re: How to insert new record above existing
            AnnetteVillarreal

            It's a table view of records. It was unsorted, so I added dates to all of them to sort them by date. But when I pressed sort, it sorted by their first number (the month), so they're all out of order. How can I make sure they sort by year, not month?

            • 3. Re: How to insert new record above existing
              GuyStevens

              Create a new calculation field with the following  calculation:

              Year (YourDateField)

              Set the result to be "number"

              This calculation will result in the year of the date in the date field.

              You don't need to display this field in yout table or your layout. But you can use it to sort.

              • 4. Re: How to insert new record above existing
                AnnetteVillarreal

                Great, thank you both! It works now!

                • 5. Re: How to insert new record above existing
                  philmodjunk

                  If the date field is of type date, this calculation field should not be needed in order to sort the most recently created records to the top.