Server Side Scripts: Get & Restore Context
Traditionally, performance in computing has revolved around the optimization of bits and bytes — how many can be saved and how efficiently a task can be accomplished. This principle dates back to the era of computers with only a handful of kilobytes of memory, where maximizing efficiency was critical. Fast forward to today, and the same principle holds true. Despite various ways of achieving the same outcome, the ultimate question end-users continue to ask is: 'Can you make it go faster?'
Enter Perform Script on Server (PSOS), a realm where speed becomes almost a certainty. Here, actions occur where the data is stored, eliminating unnecessary back-and-forth between client and server, with the resulting communication involving updating the client's user interface. PSOS becomes particularly advantageous when a client, perhaps viewing a single record, triggers an action which impacts a significant number of records — say, 20,000. In such cases, leveraging PSOS is imperative.
The challenge with PSOS lies in its somewhat invisible nature, requiring troubleshooting and debugging skills to fully grasp. Equally critical is the task of restoring the current client's context, comprising two essential components: the layout (base table and pertinent relationships) and the found set of records. Thankfully, FileMaker offers a built-in mechanism to handle context restoration.
This video, accompanied by a supporting technique file, equips you with two invaluable scripts — one for obtaining and the other for restoring server-side context. Let's learn how to harness the power of PSOS efficiently and restore some context!
- Read more about Server Side Scripts: Get & Restore Context
- 5 comments
- Log in or register to post comments
Server Side Related Record Duplication
Knowing how to take advantage of Server Side scripting within FileMaker is quite critical when you want the best performance possible. Of course, it makes total sense that you'll get the best speeds when working with the data where it's most accessible.
The trick with creating scripts which will also work on the server side is being very specific with the context of things. There's also the very important choices of which method you're going to use. In 2018 I covered a method using a dedicated table occurence which is perfectly viable today. However, I didn't show the other methods possible and we also got some newer features which allow us to do things even more differently.
This video shows you how to write a script which will duplicate related record sets and do so using the method of exporting and importing. I also cover a method which uses JSON in order to replicate a set of related records. This code can be used in many more places than just duplicating related record sets. I hope the content helps you advance your level of FileMaker development knowledge.
- Read more about Server Side Related Record Duplication
- Log in or register to post comments
Server Restored Contexts
Prior to FileMaker 13 we never even had the option of performing scripted tasks where the data actually exists. The processing of a script, client side, always had, and still does, make a full round trip for all kinds of these processing activities. Many times, FileMaker does it's best to optimize whatever is being done, but it's still not as fast as executing certain things directly on the server.
With the addition of Perform Script on Server we gained a REALLY BIG performance boost by being able to perform most any script on the server.
While there are still various limitations, such as the number of simultaneous server side scripts, it's absolutely something that any serious FileMaker developer needs to know how to use.
One of the biggest issues with running server side scripts with Perform Script on Server is the fact that you need to know what's happening when the script is running, how to troubleshoot and most importantly, how to replicate the current user context. That is, the proper layout and the exact same found set to be used for processing the data. This video specifically covers how to restore the user context for processing a found set of data. If you're interested in making this process happen as quickly as possible, then using Perform Script on Server is what you should learn to use.
- Read more about Server Restored Contexts
- 1 comment
- Log in or register to post comments
Using Copy All Records
Knowing which features to use and when to use them is great skill to have with FileMaker Pro development. Anytime you can determine when a certain script step, structure, web viewer or plug-in should be used is what makes for a productive developer.
In this video we’ll take a look at a long standing script step called Copy All Records. Using this core script step allows us to optimize a lot of things so we end up with a faster FileMaker solution.
With the additional tips and education in this video, you should be that much closer to solving a number of various issues for your FileMaker database. Make sure you know how to use Copy All Records in the most efficient manner!
- Read more about Using Copy All Records
- 7 comments
- Log in or register to post comments
Understanding Perform Script on Server
When FileMaker 13 was released, one of its sleeper features was Perform Script on Server. Yeah, developer’s recognized it, but didn’t really know how to value its power.
With the subsequent release of FileMaker 14, and FileMaker Go 14 in particular, the advantages of Perform Script on Server simply can’t be overlooked by anyone creating solutions within FileMaker Pro.
If your FileMaker solution has any number of users, beyond a very small number, then the performance gains can be quite significant for certain tasks.
While certain script steps like Export Field Contents cannot be used with Perform Script on Server, there is a wealth of functionality which can be harnessed through the use of server side plug-ins. Because of what you can do on the server side, there are few, if any limitations. Need to communicate with other web services via ODBC, SQL, REST, SOAP (pick your acronym)? Want to send bulk HTML email using an online service like Amazon’s SES mail sending? Need to automate a routine import which normally task just a bit too long?
Using PSoS is simply a matter of understanding what’s happening server side and knowing how to troubleshoot. Fortunately, this video will provide you with all the know-how!
- Read more about Understanding Perform Script on Server
- 5 comments
- Log in or register to post comments