3 Replies Latest reply on Mar 29, 2016 8:23 AM by ChristianNissen

    Script search that return no rows?

    ChristianNissen

      Hi again,

       

      I am trying to learn to master FM, from manuals and examples. I am greatly helped by "FM14 - the missing manual" creds to the people that wrote that!

       

      Now I run into problems understanding whats needed to write a script that makes a selection like this SQL statement.

       

      SELECT *

      FROM debitering

      WHERE kollad = "J"

       

      I just cant make it work with the scriptwindow?

       

      Scriptsearch1.png

      To further complicate matters I have no idea on how to deselect the use of local language (in this case swedish) from the scripting?? I have written a separate question on that in these forums.

       

      The script I am using would be the first scriptcommand in the list of "Searchresult" in the english version.

       

      I would expect a returning list of all the rows in the small table above where "Kollad = "J"  instead I get nothing and on top of that an errormessage saying "No recs found, do You want to continue?".

       

      I havent got a clue on how to write a functioning script, anybody who knows, or even better if anybody knows how to use real SQL statements in scripts?

       

      I expect all scriptsuggestions in english as probably few of You are locked into the swedish FM-version

       

      scriptsearch2.png

       

      Cheers now!

       

      Christian

        • 1. Re: Script search that return no rows?
          taylorsharpe

          Go to Layout [ original layout ]

          Enter Find Mode []

          Set Field [ TABLE::Kollad ; "==J" ]

          Set Error Capture [ On ]

          Perform Find []

          Set Error Capture [ Off ]

          • 2. Re: Script search that return no rows?
            taylorsharpe

            In FileMaker, Layout sets the context, so be sure you go to a layout based on the table you need to search from. 

             

            Also, just to search where anything begins with J in Kollad, just put a J in there.  The == part means exactly equals too.  FileMaker loosely does finds unless you specify exact, which is the opposite of SQL where you have to do LIKE for loose finds. 

            • 3. Re: Script search that return no rows?
              ChristianNissen

              Thanks for the effort Taylor.

               

              Very difficult to implement as FM has decided that my scripts MUST be in swedish!!!

               

              And I am not sure what the corresponding command to "Enter Find Mode" would be in swedish?  (the other suggestions You had, I think I have found the corresponding swedish commands to)

               

              If You use the menu to the right of the scriptwindow my 6:th chapter would be "posts/recs" and the 1:st subselection there would be "ny sökpost". What "chapter" and what subitem is "Enter Find Mode" in the english version of FM You use, perhaps I can find the corresponding command that way?

               

              I REALLY hate when a company wants to be helpful and hasnt thought their "helpfulness" through... in this case that I cant use Your english commands, cos FM decided my native language would be so much better....

               

              Regards

               

              Christian