1 2 Previous Next 21 Replies Latest reply on Jan 17, 2013 9:36 AM by malibux14x

    How Do you search in no repeating fields or the entire page?

    Malibux14x

      Title

      How Do you search in no repeating fields or the entire page?

      Post

      Hello.

       

      I upated my PO and changed from repeating fields to non repeating fields at the adivce of a few people.

      when the fields were repeating all i had to do was input the desired style name (for example) into the first field and it will search all 20 repeating fields and yeidl results.  now it wont do so.  i have to input into each field one at a time.  as you can see this is time consuming.

       

      is there an easier way to do this?  maybe set up a search to search the every field in the entire record?

       

      thank you for your help/

        • 1. Re: How Do you search in no repeating fields or the entire page?
          philmodjunk

          Those should not be "non repeating fields" defined in the PO table. They should be fields in a record defined in a related LineItems table. Then you can put a portal to your line item records on your PO layout and you can specify search criteria in them just as you did your repeating fields.

          • 2. Re: How Do you search in no repeating fields or the entire page?
            Malibux14x

            Thank you for your response.  But now im a little confused.

             

            I have 20 lines on my PO and 13 coloums.  when i type in the 'STYLE NAME' the 'STYLE ID,' 'COLOR,' and 'PRICE,' (not pictured) pops up as it is linked to the styles database.  (see photo) 

             

            is this set up incorectly?

            I used to have it as Repeating fields then i could just search in the top field and it would search all 20.

             

            i would like to search for all my clients whom ordered a certain style (STYLE A).  but i cant do that easily any longer.  what would be the easiest way to do so?  portals are still very confusing for me but i could try to figure it out if needed.

             

            thanks.

            • 3. Re: How Do you search in no repeating fields or the entire page?
              philmodjunk

              is this set up incorectly?

              Yes.

              Use a related table for the PO items instead of individual (or repeating) fields.

              Here's an invoice demo you can look at. Invoices and PO's use the same structure, the only difference is the name of the Invoice table would be changed to "purchase order".

              http://fmforums.com/forum/showpost.php?post/309136/

              • 4. Re: How Do you search in no repeating fields or the entire page?
                Malibux14x

                ok so i created a Portal which contains the Style ID, Stle Name, Color, Sizes, Total units, Price per style, and total cost per style.  if there a way to import my old records into this po?

                 

                I also created buttons on the old format.  one button erases the info on that line (Style name, style id, style color).  the next erases all the sizes on that line.  the 3rd matches the sizes from the first style on one particular line and the 4th copies everything from that line up to the first style.

                 

                so if on first line i have Style X, W1234, Black, 2S, 3M, 4L, 5XL, 6XXL, and 7XXXL and i hit button 3 on the next line it will copy the same size run only to that second line.  if i fill in 10 styles and hit button 4 on style line 10, it will match all the same size runs.

                 

                will i be able to utilize a feature like this as well?

                • 5. Re: How Do you search in no repeating fields or the entire page?
                  Malibux14x

                  plus, in the meantime while i am trasfering info into new format, is there a way to search every field in every records for a certain word to yield a group of results?

                  • 6. Re: How Do you search in no repeating fields or the entire page?
                    philmodjunk

                    If you have FileMaker 11, you might see if you can get what you want with "quick find". It's also possible to write a script that performs a find by generating one find request for each different field, entering the same find criteria into each such different field. This sets up an "or" type find where you find records with the specified data in field 1 or field 2 or field 3.... It can be a very tedious script to set up if you have a lot of these fields.

                    If you can use a copy of your original file with repeating fields, you can use import records to generate a new table with the repeating data broken up in to one record for each repetition that contains data. That's your best bet if this is still possible.

                    Using a button with a script to replicate the data in one or more fields to a new record in the same portal can certainly be scripted. You can copy data to variables, (including the ID field that links the purchase order to the line items), then switch to a layout based on the related table, create the new record, copy values from the variables to the new record and then switches back to the orignal layout where you'll see the new record appear in the portal with the duplicated data.

                    • 7. Re: How Do you search in no repeating fields or the entire page?
                      Malibux14x

                      thank you.  ill look at the buttons later but for the search field, i am using 10 pro, what that be a text, calculation, summary or container field?

                      i would have 20 fileds per record.

                       

                      so an example would be i want to find wich client ordered the LEON. 

                       

                      iw ould type in LEON into a field and it will populate all the POs with LEON in the STYLE NAME field (no matter the line its on)

                       

                      so the code would have something like STYLE NAME 0r STYLE NAME2 or STYLE NAME 3...?

                      • 8. Re: How Do you search in no repeating fields or the entire page?
                        philmodjunk

                        Populate and Find are two different actions. This script will find all records with a style name in on of the twenty fields matching the name specified by the user.

                         It looks like your fields are named StyleName,  StyelName2, SytleName3... The script relies on a consistent pattern to the field names.

                        Define a global text field named gStyleSearch. The user will enter a style name in this field then perform the following script:

                        Enter Find Mode [] //clear the pause checkbox.
                        Loop
                           Set Field by name [ "Pos::PO Style Name" & $K ; Pos::gStyleSearch ]
                           Exit Loop If [$K = 19]
                           New Record/Request
                           Set variable [$K ; value: $K + 1 ]
                        End Loop
                        Set Error Capture [on]
                        Perform Find []

                        • 9. Re: How Do you search in no repeating fields or the entire page?
                          LaRetta_1

                          If you still have the file with repeating fields, you can import and specify within the import dialog to split the repeating fields into records to import into your new Styles table.

                          If you cannot do that, you can split fields into records by placing all the 'Style' fields onto one layout (with no other fields), in sample file the layout is called 'temp project names' and running a migration script similar to this one:

                          www.directlinesolutions.com/downloads/migrate.zip

                          Smile

                          • 10. Re: How Do you search in no repeating fields or the entire page?
                            Malibux14x

                            Define a global text field named gStyleSearch. The user will enter a style name in this field then perform the following script:

                            Enter Find Mode [] //clear the pause checkbox.
                            Loop
                               Set Field by name [ "Pos::PO Style Name" & $K ; Pos::gStyleSearch ]
                               Exit Loop If [$K = 19]
                               New Record/Request
                               Set variable [$K ; value: $K + 1 ]
                            End Loop
                            Set Error Capture [on]
                            Perform Find []

                             

                            I was having a challenge creating that script.  Scripting is somewhat new to me so when i went to edit the 'Set Field by Name' section i got an error.  (see photo)

                            and to help me understand what i am doing, what are the definitions of $K and what does each step do? 

                             

                            do i create the script then set the field mode as a script trigger?  how will this function?

                             

                            thanks again.

                            • 11. Re: How Do you search in no repeating fields or the entire page?
                              LaRetta_1

                              I was not clear - my apology ... I was suggesting that the structure should be changed first.  Once changed to relational, this script will be unnecessary and many additional issues (because of incorrect structure), will be avoided completely.

                              Build the best from the ground up otherwise you will find yourself unraveling your knitting and starting again.  It wastes a lot of time and energy and worse - later when you realize the mistake, you may decide to leave it because fixing it is then much more complex.  And so you end up with crud-code in your solution which slows it to dawg speed.  And it is always easier to create than to rebuild.

                              Structure is most important and this is structure we are talking about ... how to search most efficiently and the answer is 'search one field through a table of records'Laughing

                              • 12. Re: How Do you search in no repeating fields or the entire page?
                                philmodjunk

                                Please keep in mind that the script is a temporary bandaid. As LaRetta and I have both recommended, you need to modify your table design to get a better system in the long run.

                                The error you are getting is because the text from the semi-colon (;) on is not be be entered with the first specify button. Click the upper specify button and enter the first expression. Click the lower specify button and enter the second expression. Do not enter the semi-colon, FileMaker will supply that character after you enter the second expression and click OK.

                                • 13. Re: How Do you search in no repeating fields or the entire page?
                                  Malibux14x

                                  ok i finally had a chance to try to create this script with the gStyleSearch field.

                                   

                                  it unfortunaltey, didnt work for me.  maybe i am doing it wrong.  i set the script in the "set script trigger" on onobjectsave.  is that correct?

                                   

                                  then i typed in a style name and nothing happened.  it seems to search the fields but doesnt pull up anything of relevence.  just drops me at some random record.

                                   

                                  i agree that i need to restructure the whole thing but when i tried that there are so many confusing bugs that i am not familiar with yet to make it work.  if any of you live in LA i could hire you to help me.  :)

                                  so in the meantime, i really need to create a box, that when i type in a style name, it searches all the records and populates all records (clients) that ordered that style.

                                   

                                  any advice?

                                  • 14. Re: How Do you search in no repeating fields or the entire page?
                                    philmodjunk

                                    There are any number of different ways you can start this script off. The OnObjectSave trigger should work ok. (You can also put a button next to the field for this or use OnObjectModify, if you format your field with radio buttons or a pop up menu of styles to select.)

                                    Run the script and then note the numbers in the status area to the right of the green "pie chart" to see how many records were "found".

                                    You can then review the actual criteria used in the find if you pull down the records menu and select Modify Find. You should see a series of apparently blank records (called requests in find mode) with just the data from the gStyleSearch field entered in a different field on each request.) If you don't find any criteria entered,  just blank requests and the script produced a found set of all the records in your table, your gStyleSearch field does not have global storage specified. Open manage | database | Fields, find the field's definition and double click it. Then select global storage on the storage tab.

                                    1 2 Previous Next