10 Replies Latest reply on Sep 11, 2012 2:57 AM by bagheraa

    Void fields are not found by "*"

    bagheraa

      Title

      Void fields are not found by "*"

      Post

      Hello,

      I'm making a search on a table by coincidence on several fields using the command "Constrain Found Set". In the table, there are several reccords with fields that are void. If I put the criteria "*" (none or more characters) in the field constrain, they are rejected by the command and they are not found. Is this a bug?

      Thanks.

        • 1. Re: Void fields are not found by "*"
          Sorbsbuster

          Try removing the quotation marks.

          • 2. Re: Void fields are not found by "*"
            bagheraa

                 Thanks for your answer, Sorbsbuster.

                 The quotation marks are in the post only for diferentiating it from the text. In the command they not appear.

                 The command work fine for the fields that are not empty, but fail to include the empty fields. ¿Have you encoutered the same problem?

                  

            • 3. Re: Void fields are not found by "*"
              bagheraa

                   You can reproduce the problem creating a new database with one table, with two fields, one for the id and other for a text. Fill in some records with data, and left the text field of one record void.

                   Create then a script with two commands:

                   Show all records and Constrain found set

                   In the Constrain command create a new find with the text field with *.

                   Run the script and you will see tha the record with the void text filed is left out, wich is wrong as * means none or more characters.

                    

              • 4. Re: Void fields are not found by "*"
                Sorbsbuster

                     The hint beside the * character in the 'Insert operators' menu in Find Mode says 'zero or more characters'.  I don't know what that means, because every field has either zero or more characters.

                     But the Help page says 'to find fields that are not empty (ie: fields that have data), use this character: * '

                     To find fields that are empty you should put = as the search criterion.

                      

                      

                      

                                                                                 
                                                           

                      

                • 5. Re: Void fields are not found by "*"
                  bagheraa

                       My problem is tha I'm creating a filter that is filled by the user, and is targeted by several fields (name, description, type, etc..).

                       I thought that putting * on all the filter fields can be an easy way to find all the records. If this is not so, how can I make the filter system?

                        

                  • 6. Re: Void fields are not found by "*"
                    Sorbsbuster

                         Sorry, I'm confised as to what you are trying to do.

                    "I thought that putting * on all the filter fields can be an easy way to find all the records" - why not just use 'Show all records'?

                         -

                    "Create then a script with two commands:

                    Show all records and Constrain found set

                    In the Constrain command create a new find with the text field with *.

                    Run the script and you will see that the record with the void text field is left out"

                         - that is the correct behaviour for Filemaker

                         -

                         Are you trying to set up a search where the user can enter the search criteria?

                    • 7. Re: Void fields are not found by "*"
                      bagheraa

                           Yes. This is the problem.

                           Being an internal public database, I don't want the users to see the the Status Area. So I have to make explicit layouts for filtering and ordering.

                           So I have created a layout for the user to enter the search criteria. In this layout there are global fields that holds up the user input. And there is also a script that executes the search.

                           The script works more or less as follows:

                      Set several script variables with the contents of the user input($name = Table::_zg_filter_name; $type = Table::_zg_filter_type; ...).
                      Show all records.
                      
                      Constraint search, with the criteria (Table::name=[$name] AND Table::type=[$type] AND ...)

                           If the user fills out all the filter fields with *, it should mean tha the user wants all the records. But instead if finds all the records with fields that are not empty.

                           My problem is that in some cases, the description field is left empty (because the name and type are enough descriptive, for example).

                           Also, as the record is created as a new line in a portal, the option to check the contents when the record is saved is very ugly, and the users are very confused with the messages.

                           I have tried also to set the table field as not empty in the database manager field properties. But the behaviour in the new line of the portal is worst. The focus is tied to the field and there is no way to continue but filling it with some content. The user cannot even cancel the creation of the record.

                           I'm working now on an equivalent development that draws the problem. Can you give me some suggestions?

                           Thanks.

                            

                      • 8. Re: Void fields are not found by "*"
                        Sorbsbuster

                             I think you are describing two different problems.

                             1: You want the users to specify a Name and/or Type to search for.
                             2: You have a different problem connected to creating a new record.

                             Can we answer the first problem first?

                             I would suggest you show a Custom Dialogue and ask the user for input to the two global fields, and capture them as $Variables (as I think you have done).  In the custom message I would say, "To see ALL records leave both boxes empty".

                             Then check in your script if the two $Variables are empty.  If they are, do a Show All Records script step.  Otherwise enter find mode, set the fields with the $Variables, and perform the find.  You should also include and Set Error Capture [On] so that you can handle what happens if no records match their request.

                             That way also the user does not have to remember that * means 'Show All non-empty records".

                        • 9. Re: Void fields are not found by "*"
                          bagheraa

                               Thanks for your answer, Sorbsbuster. Its very useful.

                               I have made the user input as a layout in a new window, in place of a Custom Dialog (it is more elegant), but the behaviour is the same: getting the $Variables of the filter.

                               For the script I will follow your instructions, making as many Constrain commands as variables the user can input, and making the constrain only if $variable is not empty. I think this will solve my problem.

                               I will tell you the result.

                               Many Thanks again.

                                

                          • 10. Re: Void fields are not found by "*"
                            bagheraa

                                 It works!!!!

                                 Thank you very much.