10 Replies Latest reply on Aug 24, 2014 3:57 AM by user21635

    Perform script on Server

    user21635

      Is probably wonderful. I can test a simple script to find a range of records in a table but how do I then get the result to display to the client? Finding isn't the purpose of the exercise, just a test. I need to be able to sort and manipulate a large number of records on a hosted server and i presumed that doing this on the server would be the perfect solution. Am I missing a simple extra something? Whenever I test the result of a find I always get a correct found count so something is happening.

        • 1. Re: Perform script on Server
          mikebeargie

          I think you might be off in what you're trying to do here. Finding the records is not something you really want to use PSoS for, only the manipulation of said found records. Usually people are telling PSoS to find _X_ data set, and perform _Y_ updates to the data, then refreshing the client when complete.

           

          The other usage is sending stuff for PSoS to do that you don't want to wait around for, such as "create _Z_ log entry in the log table". In that case, you save time by having the server do some of the actions instead of the client, if you have a log writing script that is 10 steps, and a client is expected to generate 100 log entries per day, then you stand to save 900 script step actions on the client side by passing the work to PSoS. This allows for exponential client action savings.

           

          You will always have to "re-perform" the find on the client to see the same records you see resulting from a PSoS script.

           

          I've seen some budding genius work that involves generating and passing snapshot links of the data back and forth, but I do not have a reference for that handy. In the case of a snapshot link, FM only pulls up a list of record IDs, and (I believe) bypasses find mode. Basically processing an XML like file into a view that you see.

          • 2. Re: Perform script on Server
            user21635

            Thanks, Mike. What I'm trying to achieve is time saving for the client when, say, 1000 records are are updated in a number of fields then mulit sorted. This can take ages on hosted server (at least with our web connections). I started simple with the find script (including a sort) to test that I was getting some return.I expected to be able to go the layout and find the result but this hasn't happened, the records are any which had been there before the script was performed and unsorted.

            • 3. Re: Perform script on Server
              mikebeargie

              find and sort actions must take place on the client side in this instance. Only manipulation (IE set field, replace field contents, etc..) can be done by the server.

               

              PSoS is treated almost the same as a server scheduled script is.

               

              So the client would be expected to see the result of the manipulated data, but sorting and finding would still need to be done via the client.

              • 4. Re: Perform script on Server
                user21635

                That's a blow! At least if I can do a find and replace that will save a lot of time. Thanks for your time.

                • 5. Re: Perform script on Server
                  mikebeargie

                  Yes and no, it can save you a lot of client processing time if you use it for specific needs.

                   

                  As for the passing of a sorted found set from the server back to the client, as noted I've caught whiffs of techniques that people are trying to come up with on PSoS to make such things possible. It's a new technology, like WebDirect, so it will take some vetting out and innovation before such techniques can come out.

                   

                  I mean, we had global variables for how long before "virtual lists" became a documented mainstay in FileMaker development?

                  • 6. Re: Perform script on Server
                    user21635

                    My problem is that whilst I've been involved with writing and maintaining FM systems since FM3 (still got 2 on board in FM6) I've plodded on at my own slow pace to the extent that  every week I end up saying "Well, I didn't know you can do that now!" when I come across something new. This, also, is my first experience of FMS - but getting there - slowly.

                    • 7. Re: Perform script on Server
                      mikebeargie

                      Well, you did pick a great version of FMS to start on. Having dealt with server back to version 8, I love a lot of the new features of this version, and (personal experience) think it's been rock solid for the work I've done.

                       

                      If you / your employer has the ability to hire a mentor developer, it might be worth it to get a "fresh pair of eyes" on your database for someone that can offer advice and direction, and show you how, to bring your file up to a more current standard.

                       

                      I've been doing a lot of < FM7 conversion work lately, and almost every file I want to scrap the UI and logic and start over from scratch.

                      1 of 1 people found this helpful
                      • 8. Re: Perform script on Server
                        Mike_Mitchell

                        "I've been doing a lot of < FM7 conversion work lately, and almost every file I want to scrap the UI and logic and start over from scratch."

                         

                        Amen, brother!  

                        • 9. Re: Perform script on Server
                          wimdecorte

                          Keith Hodgson wrote:

                           

                          Thanks, Mike. What I'm trying to achieve is time saving for the client when,

                           

                          The thing is though to NOT just assume that it will save time.  When PSoS becomes part of your solutions performance strategy, the FMS specs and FMS deployment becomes a much more crucial factor (and keystone) in that strategy.

                           

                          Sounds like you have an external host, which is probably a shared server.  If all the other clients on the server decide to start using PSoS, the machine is very likely going to grind down to a halt.  So that is something that needs to be looked at and evaluated.  Does the server have enough spare capacity to handle the extra load you will be putting onto it.

                           

                          And if you are running crucial code through PSoS you have to be very dilligent about error trapping and handling, AND have a fall-back routine to run the same code on the client if you get errors back from the server or the server can not execute the script (there is a limit on the # of concurrent PSoS sessions a server is configured to handle)

                          1 of 1 people found this helpful
                          • 10. Re: Perform script on Server
                            user21635

                            Yes, we are on a hosted server. I'll check this as you suggest - and your other comments about error trapping and handling. Thanks.