7 Replies Latest reply on Mar 29, 2011 12:27 PM by philmodjunk

    Find - "No records match this find criteria" fouls my script -- Can anyone help??

    PeggiHall

      Title

      Find - "No records match this find criteria" fouls my script -- Can anyone help??

      Post

      Hello All,

      I tried to write a script that says look at the first record in the parts database, take that part number and go to the labor/parts DBF and find how many of those parts were used during the first quarter of 2010, take that summary total number and go back to the parts database and put it in the Qtr1 2010 field, and then loop through all the records.  It works ok if the part was used but if it wasn't and the "No records match....." comes up it fouls up the whole thing and actually puts the part number in my Qtr1 2010 field instead of a zero.  Tried everything I know--which isn't a lot--but can't make it work.

      I WOULD APPRECIATE ANY IDEAS ANYONE MAY HAVE.

      THANK YOU SO MUCH.

      P

        • 1. Re: Find - "No records match this find criteria" fouls my script -- Can anyone help??
          philmodjunk

          We'd need to see your script.

          1. You can upload a screen shot by clicking the edit link to your original message and uploading it there
          2. You can upload a screen shot to a file share site and post the download link to a new response you post here.
          3. You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF.
          4. If You have FileMaker advanced, you can generate a database design report and copy the script as text from there.

          From your general description, this sounds like something that does not need to be scripted. I think relationships and calculations can be used to eliminate the script all together.

          • 2. Re: Find - "No records match this find criteria" fouls my script -- Can anyone help??
            PeggiHall

            Hi PhilModJunk,

            Well, I don't have advanced cause I'm a rookie but here are the scripts.  I actually have it broken into three scripts so here they are in order.  The master parts DBF is "Shop Parts Inventory" the the file that shows what parts were actually used is "WO Labor".   Thanks, Peggi

            Go to Labor DBF get Q1 2010 count – Title part 1

            Go to Related Record [ From table: “Shop PARTS Inventory”; Using layout: “Entry Screen” (Shop PARTS Inventory) ]

            Go to Field [ Shop PARTS Inventory::Part No. ]

            [ Select/perform ]

            Copy [ Shop PARTS Inventory::Part No. ]

            [ Select ]

            Open File [ “WO labor” ]

            Perform Script [ “qtr1 2010 find records test” from file: “WO labor” ]

            Perform Script [ “ Q1 2010 count part 2” ]

            Qtr1 2010 find records test – title part 2

            Enter Find Mode [ ]

            Go to Field [ WO labor::Mech/Part No ]

            [ Select/perform ]

            Paste [ WO labor::Mech/Part No ]

            [ Select ]

            Go to Field [ WO labor::Timecard date ]

            Insert Calculated Result [ WO labor::Timecard date; "1/1/2010...3/31/2010" ]

            [ Select ]

            Perform Find [ ]

            Go to Field [ WO labor::Hours Qty Sum ]

            Copy [ WO labor::Hours Qty Sum ]

            [ Select ]

            Q1 2010 count part 3 – Title part 3

            Open File [ “Shop PARTS Inventory” ]

            Go to Field [ Shop PARTS Inventory::Qtr1 2010 count ]

            Paste [ Shop PARTS Inventory::Qtr1 2010 count ]

            [ Select ]

            • 3. Re: Find - "No records match this find criteria" fouls my script -- Can anyone help??
              philmodjunk

              First step can be a major problem here:

              Go to Related Record [ From table: “Shop PARTS Inventory”; Using layout: “Entry Screen” (Shop PARTS Inventory) ]

              If there is no related record, the script will continue to execute, but it will be on the wrong layout acting on the wrong table and record. From there chaos can ensue.

              If you use Go To Related Record, you need to check for the lack of a missing related record either just before or just after the GTRR step and take appropriate action to handle such an error.

              See here for a detailed description of GTRR and it's dangers:  The Complete Go To Related Record

              What version of Filemaker are you using? This approach has a "fileMaker 6" feel to it given that you have multiple files instead of keeping the tables all in the same file for easier manipulation of the data.

              The use of copy and paste like this is best avoided as it produces undesirable side effects that can confuse and irritate your users. You can pass data to the subsequent scripts with script parameters unless you are using an older version of FileMaker that does not support script parameters. If script parameters is not an option, you can still exchange the data between files without using copy/paste with the user of global fields and relationships between the files that permit access to them.

              Please describe the tables (files) and the relationships linking them. I doubt that you need such a sophisticated script to get what you want here.

              • 4. Re: Find - "No records match this find criteria" fouls my script -- Can anyone help??
                PeggiHall

                I'm using Filemaker Pro 11.  The two tables I'm using are Shop Parts Inventory and WO Labor.  The relationship in both tables are  "Part No." in Shop Parts Inventory to "Mech/Part No" in WO Labor.  I printed your information out as well as the GTRR post and will have to study it to understand what it's saying.  I'll work on it and see if I can resolve any of it.  Thanks for the information.  Will probably have more questions after I try this, if that's okay.

                • 5. Re: Find - "No records match this find criteria" fouls my script -- Can anyone help??
                  philmodjunk

                  Why two files? This can be much easier to do if both tables are in the same file.

                  I take it you have this relationship:

                  ShopPartsInventory::Part No. = WOLabor::MechPart No 

                  I'd really, really get rid of that / you show in the field name! It really makes expressions look ugly!

                  I recommend creating a summary report in WOLabor that counts and reports the parts used for a given year for each part. This does not require nearly so complex a script. Such a set up would have many similarities to the summary reports created in this tutorial:

                  Creating Filemaker Pro summary reports--Tutorial

                  • 6. Re: Find - "No records match this find criteria" fouls my script -- Can anyone help??
                    PeggiHall

                    The ShopPartsInventory file is an old one created years ago which I converted to FMP 11 and has about 8700 records in it.  The Labor file I made.  It contains all of our parts, labor, mechanics name, quantity (parts), dates, type of service, Work order number, equipment number, hours worked and misc other stuff in it.  It has about 24000 records in it now and just started using it last July.  I don't know how much data each database is allowed to have in it so thought it would be better to make several files and tie them together.  The field you are talking about uses either the mechanics name or the part number and I PAID A PROFESSIONAL TO HELP ME GET THAT ALL SET UP and that's what he named it.  Do you think I should just take the slash out of it or???

                    Anyhow, I had already created a summary report in the labor file and that works just fine.  Wrote a script to run the summary report for 1st quarter 2010 and give me the right totals.  I just want that total number for EACH PART to be transferred into a field in the ShopPartsInventory file so they can see right on the input screen how many of that part were used each quarter.  Just can't figure out how to get those summary totals into the Shop Parts Inventory file after I find all the information.  That's why I started with the scripts mentioned in the first post but it fouls every time it hits a part in the ShopPartsInventory that hasn't actually been input or used in the Labor file.  I'm going in circles here huh. 

                    • 7. Re: Find - "No records match this find criteria" fouls my script -- Can anyone help??
                      philmodjunk

                       / is the division operator, so when you use it in an expression, filemaker has to wrap in a messy pair of curly brackets {} to keep it from being evaluated as a division operator. I wouldn't change the name if I were in your shoes. As a developer, I could run a database design report from FileMaker advanced and check it to see if anything would be affected, but that's probably not a good option for you. There are certain expressions that may break if your developer used them such as a Set Field by Name step that refers to the name of this field in the first parameter.

                      I have files with multiple tables where the records in one table now exceeds a million records and still counting, you you can merge the tables if you wish.

                      It's possible to get to those summary fields from the other file without using a script. You can actually add the summary field directly to the layout if you have a relationship linking the two files like I think you do. With your relationship linked by part number, the summary field will display the sub total of just the matching records in the work order table. If you need sub totals for specific date ranges, like I believe you need, you can set up Filtered portals to display the summary field (One portal row and just the summary field) for the related records, but filtered by a specific date range.