8 Replies Latest reply on Apr 1, 2009 9:30 AM by ayimages

    Sorting repeating fields

    ayimages

      Title

      Sorting repeating fields

      Post

      Is it possible to sort repeating fields by the last/latest record instead of the first?

      Been searching all over for workarounds without success.

      Thx from a beginner (FMP10)

      -Anna

        • 1. Re: Sorting repeating fields
          raybaudi
            

          Hi Anna

           

          Last ( RepeatingField ) returns the last not empty value of a repeating field, so you can create a calculation field with that calc and sort by it.

           

          BTW: try to NOT use repeating fields to store data, but to create a record for every value of the repeating field.

          • 2. Re: Sorting repeating fields
            ayimages
              

            Thanks Daniele! That worked fine - I didn't know about avoiding repeating fields. I find them extremely useful when making invoices with several items because the number of items isn't the same in every invoice and the calculation across fields works like magic (well to me anyway  :)

            Regards/Anna

            www.ayimages.com

            • 3. Re: Sorting repeating fields
              raybaudi
                

              ayimages wrote:

               

              I find them extremely useful when making invoices with several items because the number of items isn't the same in every invoice...


              That is the classic situation where you need to create a related table and NOT using repeating fields.


              • 4. Re: Sorting repeating fields
                ayimages
                  

                Oh.

                Would you mind giving a summary of why that is so (sorry but I'm a complete novice). If I make a new field for each item and number and price then that would be a lot of new fields instead of only 3? My invoices are of picture licenses and the price for each item varies according to customer and use. Is there a disadvantage for using repeating fields?

                Thanks

                Anna

                • 5. Re: Sorting repeating fields
                  raybaudi
                    

                  ayimages wrote:

                   

                  If I make a new field for each item and number and price then that would be a lot of new fields instead of only 3?


                  No, not a lot of new fields, but a lot of new records.

                   

                  You have to have ( at least ) 4 tables:

                  Orders

                  Orders Line Items

                  Pictures

                  Customers


                  • 6. Re: Sorting repeating fields
                    ayimages
                      

                    Daniele, that's a bit too complicated for me but I'll have a look at it.

                    Thx/Anna

                    • 7. Re: Sorting repeating fields
                      philmodjunk
                        

                      ayimages wrote:

                      Oh.

                      Would you mind giving a summary of why that is so (sorry but I'm a complete novice). If I make a new field for each item and number and price then that would be a lot of new fields instead of only 3? My invoices are of picture licenses and the price for each item varies according to customer and use. Is there a disadvantage for using repeating fields?

                      Thanks

                      Anna


                       

                      For more information on the plusses and minuses of using repeating fields vs. Portals (which is what Daniele is correctly recommending).

                       

                      Check out this thread:

                       

                      Repeating fields: to repeat or not to repeatby JohnWolcott.

                       

                      It's filled with a very complete discussion of the issue.


                      • 8. Re: Sorting repeating fields
                        ayimages
                          

                        Thanks Phil, I'll check it out.

                        -Anna