11 Replies Latest reply on Jan 26, 2017 10:36 AM by philmodjunk

    Search field & data field


      Hi, I'd like to have your advice on this problem.

      I've lot of tables (eexample: orders, quotation...) which are connected with a General Registry with a code for each customer.


      In the table you see attached in pic, you have the CODE, wich is connected with table Registry with Name of customer of that code.

      So the Name field is a field of a related table.


      I'd like to use the name field to search the name, too.

      So I can use that field as global search field, than search with a script the name or a part of the name, but after I need to add another field with the name as result. (hope this is clear...)


      Have you any idea to use the same field for a search AND as the field with data ?

      Maybe with a field over another, one disappears if ...


      Thanks !

        • 1. Re: Search field & data field
          Johan Hedman

          In Inspector you choose what field that should be searchable or not. You can search on all related fields and that Name field is no exceptions


          Skärmavbild 2017-01-26 kl. 10.17.35.png

          • 2. Re: Search field & data field

            Sure, but I must enter in "search mode", before.

            I'd like to have a searcheable field as when you use global fields to search data.

            • 3. Re: Search field & data field
              Johan Hedman

              Global Fields are not searchable, for that you need to trigger a script to go and search in the right table. But why do you have Global Fields to show data, much better to have related data


              If you need help to build a nice search function, this module is something to look at


              • 4. Re: Search field & data field

                Let me explain better, I don not want a global field, was only an example.

                In attached pic, you see a global field (red) and the related script to search code or name.


                Could be possibile to do the same in the field in green, that is the field containing name of customer ?

                But is it possibile to do in some way without entering in search mode ?

                This is my question, and I think this is not possibile.


                Unique way is to have a menu list and let it complete name, but it is not usefule if I search a part in the middle of data.

                Screenshot 2017-01-26 11.27.32.jpg

                • 5. Re: Search field & data field

                  I like Universal Search, I will try it, even it is not related to this question.

                  Thanks !

                  • 6. Re: Search field & data field
                    Johan Hedman

                    If you show you related field in your layout you can do any kind of search on that field.


                    If you want to have a Global Field to show customer that you search for in a script, that is find, but much better to let user search on real data then on a Global Field


                    Skärmavbild 2017-01-26 kl. 11.43.58.png


                    For example in my Contact Persons table I have related Company. I then show this field as related data. If I then go into Search Mode


                    Skärmavbild 2017-01-26 kl. 11.44.58.png


                    Same field is there to search in.

                    • 7. Re: Search field & data field

                      I use a global field named Search, that is in the header of my layout.


                      It has an OnObjectValidate script trigger attached to it, that when triggered by pressing 'enter', 'return' or 'tab'*, runs a search script that I wrote which searches which ever fields I need it to.


                      * The "go to next object" check boxes need to be checked in the inspector

                      • 8. Re: Search field & data field

                        Phil, this is my solution, too.

                        I can search with pressing button or enter.


                        I'd love to do the SAME directly in the field, but I think this is not possibile.

                        If I do a search in related field "CUSTOMER NAME" in the ORDER layout it find any order with that customer, I don't want this.


                        I am creating an order, and I don't remember code of customer. I go in related field "CUSTOMER NAME" , and I do the search there directly, for example using a part of the name of customer that I remember.

                        Actually I have a button that opens a small layout where I can search the name or part of the name, and than I can use the result given from CUSTOMER LIST table in ORDERS table/layout.

                        The button is the blue one.Screenshot 2017-01-26 11.57.20.jpg


                        Screenshot 2017-01-26 11.57.34.jpg

                        • 9. Re: Search field & data field

                          You can't have it both ways.


                          Either you have a field where you enter search criteria while in Browse mode and a script uses one of a variety of methods to find the desired records or you enter find mode and then specify search criteria directly in the data field. If you were to enter search criteria directly into that data field while in Browse mode, you are altering the data stored in that field and this would not be a good thing.


                          I suppose that you could, put a transparent global search field directly on top of the data field with a script trigger to perform the script that finds your records.

                          • 10. Re: Search field & data field

                            Think about logical information flow and user friendliness.


                            When you hit the "New Order" button you should be presented with a popover having a global and a portal showing the clients, plus a cancel and OK buttons. You choose the client you want, if OK is hit THEN you create a new order record and fill in the info found, otherwise not.

                            • 11. Re: Search field & data field

                              For working, fully documented examples of what siplus is suggesting download this file:


                              Adventures in FileMaking #2-enhanced value selection