9 Replies Latest reply on Mar 5, 2013 2:00 AM by AlastairMcInnes

    I want to see records modified yesterday

    emaven

      Title

      I want to see records modified yesterday

      Post

           I want to see records that were entered yesterday. 

           I have several different tables and use only one of them for this purpose. 

           I followed the directions from here  http://forums.filemaker.com/posts/2b429ffbcf?lang=en_US and added a few more steps of my own, but it doesn't quite work.

           The problem is with this statement:  Set field [Yourtable::yourdatefield, Get(currentdate) - 1]

           yourdatefield has the correct field name, but when I run the script, it uses another field in which to insert the date. At this point I get the message no records match. If I choose modify find, and manually cut the date from the wrong field, and paste it into the correct field, the find does work. 

           I have put the correct name into the script by picking it from a list in the correct table. But I can't figure out why it it does not use it when run.

            

            

      Screen_Shot_2013-03-04_at_3.17.16_AM.png

        • 1. Re: I want to see records modified yesterday
          AlastairMcInnes

               I'm not an expert (in fact, I'm only here to post a question of my own) but there's something odd-looking about the SetField statement. I wonder if that & in the middle shouldn't be a ;

               There need to be two parameters for SetField, separated by a semi-colon.

               Worth having a look at, I'd have thought.

          • 2. Re: I want to see records modified yesterday
            emaven

                 The sample I followed had a comma but the calculation did not work that way. It said I need an operation. There were no commas, nor semicolons there. It also said somewhere that the field was a text field, which did not make sense, but I tried the & anyway. I couldn't get the calculatin to save unless I put something there. I'm  sure this is the problem, but I don't know how to fix it. There don't seem to be any choices. 

            • 3. Re: I want to see records modified yesterday
              AlastairMcInnes

                   From the picture you posted, it looks like you're using a Mac and that could be different from Windows but I've attached a little snippet of a script in one of my files.

                   If I click on the upper "Specify" button (and make sure that that check box is ticked next to it), I get to choose the field - the Modified Date in this case. 

                   If I click on the lower "Specify" button, I get to enter the calculation that you can see "> $LastExport" where $LastExport is a variable I've defined earlier in the script.

                   Do you have FM Pro Advanced? The Script Debugger is worth the licence cost on its own - you can step through them a line at a time and see error codes if applicable. It cut hours and hours out of my development time when I talked the boss into shelling out for Advanced.

              • 4. Re: I want to see records modified yesterday
                emaven

                     Yes it is a Mac. But it should work the same. Unfortunately I don't have a boss to get me the advanced version. (or maybe fortunately) Are you saying I should use both the upper and lower choices?  The upper to pick the field and the lower to put the Get.....? I am not at the Mac right now to try it. There used to be manuals with programs. I hate picking through help files to find what I need to learn. It is too much like a treasure hunt. But once I know something, I like to use the online help.

                • 5. Re: I want to see records modified yesterday
                  philmodjunk

                       When Setting up Set Field, there are two Specify buttons that must be clicked. To get Set Field [Table::Field ; Expression], add set field to your script and click the first button (specify target field). Select Table::Field from the list of fields. Do not click the specify button next to the repetition box. Click OK to close this dialog box. Now click the lower specify button (calculated result) and create the expression to the right of the semicolon (;). Do not try to type in the semicolon.

                  • 6. Re: I want to see records modified yesterday
                    emaven

                         That did work. Thanks.

                         Can you explain the difference between the calculation being used in the upper or lower box.

                         I don't understand the difference. And certainly did not know there was a difference.

                         Or point me to a place where I can read about this.

                          

                         Thanks.

                    • 7. Re: I want to see records modified yesterday
                      symbister

                           Upper Specify Box is the name of the field that you are setting; Lower Specify Box is the value that you're setting that field to.....

                      • 8. Re: I want to see records modified yesterday
                        emaven

                             but the same calculation is in the upper box too

                        • 9. Re: I want to see records modified yesterday
                          AlastairMcInnes

                               Are you sure you're not looking at the SetFieldByName script step? It does, indeed, have a calculation box for both specifying the field name and the value to be placed in the field.

                               The SetField script step's upper "Specify" button only opens a list of fields in the current table from which you choose the one where you want the value to be placed. 

                               At least, that's what they do in my version - FM11.