4 Replies Latest reply on Jul 21, 2016 11:43 AM by analistamarcio

    Crop find script

    HarryFisher

      Can some kind person tell me how to write a basic script that filters out the spray records (usage layout)

      applied to a crop (shown in crop table layout)

      that is part of  a land parcel (called a field in England)

       

      So I would like to ask the user

      Which field ? (Field Name)

      Which crop ?( Crop code from the existing value list called crop code))

      then display the records found that match

      on a layout called single crop records

       

      Many thanks H

        • 1. Re: Crop find script
          SteveMartino

          It appears you want a script to 'Find' certain records, based on 2 parameters of user input.  You don't say which version of FM you are using.

          There are a couple of ways. Easiest would be 2 global search fields on the layout and a search button.  Each field would be tied to a value list, so the user can only select existing values (if preferred).  The button would gather both criteria and perform a search.  Better would be both dropdown fields, and a conditional value list, so after the user selects the field, then the next dropdown would only show crops from that field.  The find script would perform the find, change layouts (I assume based on the same Table or Table Occurrence).

          So Method 1:  2 dropdown global fields, value list & conditional value list (add a table occurrence), script and layout.

          Little better would a popover or modal window to gather the search criteria, perform the find, if records, then go to new layout.

          If you are unfamiliar with conditional value lists, scripting, etc., it may be best to post a sample file for someone to modify

          • 2. Re: Crop find script
            HarryFisher

            Steve

             

            Thank you for the reply. I am using FileMaker 14

            Do you mean post over the whole DB ?

             

            H

            • 3. Re: Crop find script
              HarryFisher

              I have made 2 global fields and put them on the layout.

              The first popup list works fine but I am not sure how to make a conditional value list to show only crops from the selected field.Screenshot (91).png

              • 4. Re: Crop find script
                analistamarcio

                Hi, Herry!

                 

                Did you find your sollution?

                Maybe you can try use self relationship... something like that:

                - create a text calculation field (table::FieldName & table::Crop_Code);

                - create a self relationship on "table";

                - create a list values based in the relationship.

                 

                Cheers,

                Marcio Nunes Ferreira.