When you should NOT use PSOS
|
We have looked a bit at PSOS and examples where it can produce better results than running a script locally. Now let’s shift on to cases where you should probably not use PSOS. Beware the unsupported script stepYou may already know this but not every script step is supported on every FileMaker client. Even for FileMaker Pro there are some unsupported script steps - most notably those for mobile devices. With any script step it may also be partially compatible. For example, there is an option in the Go to Layout script step to switch with an animation. While the script step is compatible with all clients, the switch with animation is only available for FileMaker Go. When we are talking about PSOS we need to check if a script step is compatible with Server. When you check the Help, there is a section for every script step on Compatibility. The column labelled Supported lists the compatibility for each product as either Yes, No, or Partial. The server products are also separated into FileMaker Server and FileMaker Cloud as there is sometimes a difference between these products. One script step that is not compatible with FileMaker Server is Save Records as Excel. This is a script step that saves records to a specified Excel worksheet. If this script step is used in a PSOS script, when the server reaches it, the step is skipped, it returns error 3 (“Command is unavailable”) and the script continues. Without explicit error trapping the PSOS script would appear to have completed but it has unknowingly skipped a step. Partially compatible script steps are more tricky. This is where certain options of a script step are not supported by a product such as FileMaker Server. A common example is the Import Records script step. Scripts running on FileMaker Server can only access certain folders. If the Import Records script step is set up to an inaccessible folder, it returns error 100 (“File is missing”). Another limitation of Import Records running server-side is that it is not able to import from a FileMaker file even if it is between tables in the same file. This limitation is not explicitly contained in the Help page for Import Records, but is mentioned in a Knowledgebase article. Scripts that require interactionScript interaction is another area where PSOS is not the right method. Some scripts require the user to make decisions during the script. An example is where the user is asked if they are sure that they want to delete the found set of records (permanently). This may be done with a custom dialog. The script pauses, waiting for a response. Obviously the server is not able to provide any response. The Show Custom Dialog script step is not compatible with FileMaker Server or FileMaker Cloud. In a PSOS script the Show Custom Dialog step is ignored and the script would continue on to the If statement testing which button was pressed. My testing shows that the function In a similar way, the Delete All Records script step is listed as partially compatible with Server. It is a supported script step but not With dialog: On. If dialog is set to On and this is run in a PSOS script, then the Delete All Records step will run with dialog Off. To bring together all this discussion so far, here is a quick quiz question for you. What will happen when the following script is run as PSOS?
In the first custom dialog there are two buttons defined: button 1 is No, button 2 is Yes.
We will reveal the answer and continue this discussion in the next post.
|