6 Replies Latest reply on May 27, 2013 12:34 AM by Tigeen

    Get current sort order in my script or calculation

    Tigeen

      Hello,

       

      In a project, we have a unusual requirement, and this is the simple description :

       

      We need to get the current sorting order of the current window.

      Is it possible to get the current sorting order within a script running in IWP ?

       

      I have not found any FileMaker native way to know what is the current sorting of the current window.

      So I have been using the snapshot link generation in order to get this information from the fpsl file that is generated, which was fine till now.

       

      But in IWP, this functionality is not available.

       

      We are running FileMaker Server 11 Advanced in Windows 2008 R2 server.

       

      We are open to the use of any plugging.

       

      Best regards.

       

      Francis

        • 1. Re: Get current sort order in my script or calculation
          fitch

          Do you have to allow the user to do custom, arbitrary sorts? If so, I don't know the answer. If not, e.g., the user clicks on a column head to sort, you'd use a script to control the sorts, and store the current selection in a global field or variable.

          • 2. Re: Get current sort order in my script or calculation
            Tigeen

            Hello fitch,

             

            Thank you for your quick answer.

             

            Yes, users do custom sorts.

             

            I have no other way solution in this project, the user chooses the sorting order (multiple fields, related, Asc or Des, etc.).

            Arbitary sorts are not acceptable for the client, not that I didn't try to make buttons to solve my problem...

             

            I was wondering if the pluging API proposed by FileMaker give the developer access to the information of the record set of the current windows, means maybe it's sorting order...

            Technicaly it would be easy for FileMaker, as they do it perfectly well with the snapshot link they generate...

             

            Any idea ?

            • 3. Re: Get current sort order in my script or calculation
              fitch

              My first question should have been: why do you need the sort order? Perhaps this is an XY problem.

               

              At any rate, when deploying IWP it often comes down to managing client expectations.

               

              Not to derail the thread, but I'm curious about what you're doing with the snapshot link, it sounds interesting.

              • 4. Re: Get current sort order in my script or calculation
                Tigeen

                Well, the client is a very big client.

                They have FileMaker at all levels.

                I am in a test project on only one department.

                There they have approximately 80 different FileMaker applications.

                The problem, FileMaker has been developpement in each small office of the department, in the well know "anarchistic" FileMaker dev. path.

                 

                The aim of the project is to keep only the key applications managers on FileMaker Pro for developpement, and IWP for the end users.

                As IWP doesn't know how to print (max 25 records, ugly rendering, no preview mode so no reporting), we have implemented last year a print tool that will generate pdf files for the IWP clients.

                 

                We have all of it working fine, but the remaining problem is the sorting.

                Till now, it's a button that does the sorting and the pdf request, so I know what the sorting is. I can send it along as a parameter (as you mentioned in your first reply).

                But as there are so many "developers" (I would call them more super-users) and so many applications (some die, some new come along) that it is not possible to maintain buttons to print with arbitary sort orders.

                 

                I think I have to do diplomatic work to keep FileMaker on rails, as is seems that there is not technical solution.

                I hope not to fail, cause when I see the number of FileMaker licences that could be sold there and the number of development hours that could be sold, I finish hating these so mean (technical) choices FileMaker has done / and does.

                • 5. Re: Get current sort order in my script or calculation
                  Tigeen

                  and regarding the snapshot link, I use it to dynamically create sorting.

                  Means I can offer the client to select between 10 sorting options (selecting the fields names to sort with with asc or des infos.

                  Then, it is easy enough to generate the XML file (fpsl extention for the snapshot link) and open the snapshot link.

                  There is a little more mecanic than that, but being able to create dynamic sorting is worth the trouble.

                   

                  Once the mecani in place, it becomes very easy to implement any dynamic sorting...

                  • 6. Re: Get current sort order in my script or calculation
                    Tigeen

                    well, in the end, I gave up...

                     

                    IWP is so bad...

                     

                    I still wonder how FileMaker has managed selling this so long... 6 full versions...

                    1 of 1 people found this helpful