PSOS for the uninitiated


This week we're going to dive into a script step known as PSOS. If you know what PSOS is, then you've probably used it and are somewhat familiar. If you don't even know how to pronounce PSOS ("pee-soss"), then read on.

Not one but two

In fact there are two PSOS script steps:

  • Perform Script on Server
  • Perform Script on Server with Callback

Both steps have similar setup, requirements and workings. We will start with the standard PSOS and finish with the differences in PSOS with callback.

What is PSOS?

It's really all in the name – this script step allows you to run a script on the server. Effectively the PSOS script step is a command that says, "Take this script and run it in a session directly on the FileMaker Server." Obviously that server is FileMaker Server. And it can be either the standard FileMaker Server or the FileMaker Cloud version.

Here is the first requirement of PSOS – the FileMaker file must be hosted on FileMaker Server. Nothing really earth-shattering there. In fact it makes perfect sense when you think about it.

How does PSOS work?

When the FileMaker client runs the PSOS script step, the command to run a specified script is sent to the FileMaker Server. The server starts a new session in the FileMaker Script Engine (FMSE). All steps in the script are run on the server machine independently of the client.

The PSOS script step can be configured so that the client either waits for the server script to finish or simply continues with its own script.

An analogy may be useful here. Imagine that you are sitting at your desk and have a document that you need photocopied. You could either go and photocopy the document yourself or call on your assistant (let's call him Peter Soss) to do it for you.

If you ask Peter to handle it, you need to give him the document or tell him which one to find. He isn’t looking at your desk, so he doesn’t automatically know what you’re working on.

You can wait for Peter to finish and bring back the copy, or get on with your own work while he does it. In FileMaker, those choices correspond to waiting for the server script to complete or letting it run while the client continues.

An important point here is that Peter (and PSOS) need context to perform the task or script. Because they are going to operate independently of the caller, there often needs to be some context provided.

Any questions so far? More to come.


Are you late to the ScriptLogic party? If you have missed out on some of these emails, catch up here: Email Archive​

​

If you know someone else who you think might like this email, you can send them this link to subscribe: Subscribe to ScriptLogic Daily​

​