3 Replies Latest reply on Nov 2, 2012 2:39 PM by philmodjunk

    Get last input

    zebdaag

      Title

      Get last input

      Post

           Hi there,

           I have a database where multiple notes are added to one of my business contacts. I can set these notes on "Open" or "Closed". Now I want to make a list that shows all last added notes that are "Open" of all my contacts. I used a find script that finds all "Open"  this works I get the right contact but the content shown is not of the last Note but the first one....how can I make sure I see the last note and not the first one...?

            

           Hope this is clear?
           Thanks in advance.

        • 1. Re: Get last input
          johnhorner

               hi... there are a few different ways you could accomplish this (as is almost always the case with filemaker) but hard to know which is best for you.

               if you are looking at the note records in form view, and are happy with all other aspects of how this is working, you could simply add a step (or 2) to your script to navigate to the most recently created record.  if the records are already sorted by your script you can simply add the script step "go to record/request page" and specify "first" or "last" depending on how your records are sorted at that point.  if they are not already sorted, then you can add a sorting step ("sort records") just before this and specify how you want them sorted (ascending, descending, value list, etc).  this assumes you have a creation timestamp field in your notes table on which to sort.  if not, you will need to add that too.

               another method, would be to simply use a portal on your layout to display only open records and use portal sorting (double click on the portal in layout mode to access the portal options).  for this you simply need to create a relationship from the table on which your layout is based to a new notes table occurrence (e.g. "Notes_Open") and use a global field in the "parent" table that contains the word "open" (or the number "1", depending on how you are designating open records), and relate that to the open/closed field notes.

               hope that is helpful...

          • 2. Re: Get last input
            davidanders

                 The first five links in this list are useful for beginners, especially the White Paper.

            http://forums.filemaker.com/posts/39ab6dcf1c?commentId=217671#217671

            • 3. Re: Get last input
              philmodjunk

                   A portal filter may also be used to limit the notes shown in a portal to only those that are "open" or "closed".