2 Replies Latest reply on Feb 1, 2013 11:42 AM by gnf

    Basic Script - Find and Move records

    gnf

      Title

      Basic Script - Find and Move records

      Post

           Hello,

           I'm very, very new to Filemaker and am trying to design and create a database from an exisiting Excel spreadsheet of orders. In Excel I had a tab for Current Orders, and then tabs for completed orders, by year - to limit the number of records we have to view at any one time. This kept past orders available to view history of products, or customers, or vendors and make reports.

           I'd like to have something similar in Filemaker. From looking through this forum, and trying to learn, I see 2 ways of potentially settting this up:

           1. one database, with script that would move records from one layout to another when an order is complete

           2. two databases, with a script that would move records from one database to another, either upon closing out at the end of the day, or opening the current orders in the morning. 

           Any suggestion on which is better, and why?

           In working with Idea #1, I can do a script to show just the current orders upon opening the Current Orders layout, but then how do I restrict the records on this layout so that  when I do a find, completed orders are not included without having to always add that option in the find? 

           Thanks in advance for your help/suggestions!

        • 1. Re: Basic Script - Find and Move records
          philmodjunk

               1) well you don't "move" records from one layout to another. You could move records from one table to another, but you don't have to do that in FileMaker to see all records for a given year or other range of dates. This does not require a separate layout either though such is possible.

               2) and why would you do that? it can be done, but new users often want to do this to accomplish something that can be done much simpler without moving records from one table to another.

               Finds can be scripted any number of ways. One option is to set up some global fields where you enter your search criteria before clicking a button or tripping a script trigger to perform a script that finds records. Such a script could automatically include criteria that excludes completed orders.

               Here's a thread that provides a number of scripted find examples: Scripted Find Examples

               If you want a specific layout to always filter the resulting found records so that only orders that have not been completed are found, you can select Layout Setup... and specify the OnModeExit trigger, selecting the Find option to perform a script similar to this to constrain the results of any given find to just those records that are not complete:

               Enter Find Mode [] --> clear the pause check box
               Set Field [YourTable::YourStatusField ; "=" ]
               Set Error capture [on]
               Constrain Found Set []

               This script assumes that your status field is empty if the order has not been completed.

          • 2. Re: Basic Script - Find and Move records
            gnf

                 Thank you so much - I needed a little direction! I'll look through the thread you sent to see the examples. The one above looks like it will do what I wanted as well.

                  

                 Thanks again.

                 C.