Blog

Software tips, techniques, and news.

PSOS with Callback & Local Notifications in Claris FileMaker

FileMaker 2024 is here, and it's packed with two fantastic new features that every developer should know about: PSOS with Callback and Configure Local Notification. These script steps offer incredible potential, and when combined, they can deliver some truly impressive results.

youtube-preview

PSOS with Callback

Most developers are already familiar with PSOS, which stands for Perform Script On Server(). This feature allows scripts that might take a long time on a local machine to run faster by reducing the data travel distance, often making scripts nearly instantaneous.

If you think that's exciting, just wait until you hear about PSOS with Callback. With the traditional PSOS, users either had to wait for the script to complete—cue the coffee break while waiting for your FileMaker app to become usable again—or run the script on the server without waiting, hoping it would finish without errors. Neither option was ideal.

Enter PSOS with Callback, a feature introduced in FileMaker 2023. This enhancement lets users call a script after the original PSOS script finishes. Developers can now catch any errors that may have occurred during the PSOS script by passing the last error as a result of the PSOS script and using Get (ScriptResult) to address them in the callback script—something previously impossible.

It might look something like this:

psos with callback filemaker 2024 getscriptresult callback.

With the 2024 update, users can now specify whether the callback script should continue, pause, resume, exit, or halt a currently running script. Additionally, users can specify a callback script name via a calculation, providing greater flexibility in how they choose and use their callback scripts. As long as the server or client doesn't unexpectedly quit, the user doesn’t close the client before the PSOS script is completed, and no network connection is lost, users can now be notified when a script finishes and if it finished with errors.

Introducing Configure Local Notification on MacOS

“But how can we be notified when a script finishes?” you may ask. The answer is Configure Local Notification()!

First introduced in FileMaker 17, this feature has long been a favorite among iOS users, allowing them to receive notifications from FileMaker directly on their devices. Now, with FileMaker 2024, this functionality is also available on macOS and Windows. Users can receive notifications from FileMaker on their local machines, provided they allow FileMaker to send notifications in their computer settings.

This expanded compatibility means that Mac and Windows users can now enjoy the same seamless notification experience that iOS users have had for years. These notifications aren't just passive alerts; they are interactive. Users can choose options directly from the notification, such as buttons for different actions. For example, a notification might offer options to “Email Report” or “Show Report.”

psos with callback filemaker 2024 notification script complete.

When a user selects one of these options, the choice is handled by another script within FileMaker. This means that each button in the notification can trigger a different script, allowing for a highly customizable and responsive user experience. Developers can design these scripts to perform a wide range of actions based on user input from the notifications, further integrating and automating workflows.

Real-World Applications of PSOS with Callback and Configure Local Notification

Okay, we've talked a lot about these features, so let's look at some real-world examples of how they can be applied.

Imagine you need to run a lengthy report for your application. Running this report on the server instead of your local machine saves time, and using PSOS with Callback ensures you can continue working in your FileMaker application while the report runs. Set the state option to “Continue” so that the PSOS script doesn't interrupt your workflow when it finishes.

Perform Script on Server with Callback [ Specified: From list ; "Name of Server Script" ; Parameter: "{}" ; Callback script specified: From list ; "Name of Callback Script" ; Parameter: "{}" ; State: Continue ]

Once the PSOS script completes, it calls the callback script containing the Configure Local Notifications() script step.

Configure Local Notification [ Action: Queue ; Name: "Script Complete" ; Script: "Name of Script That Handles the Notification" ; Parameter JSONSetElement ( "{}" ; "Test" ; "Hello World" ; JSONString ) ; Body: "Your script is now complete" ; Button 1 Label: "Print Report" ; Button 2 Label: "Save Report" ]

A notification then pops up on your screen: “Your report is ready. Would you like to print the report or save it as a PDF?” You choose an option from the notification, and another script handles your choice, whether it's printing or saving your report.

Set Variable [ $scriptParameter ; Value: Get ( ScriptParameter ) ]
Set Variable [ $action ; Value: GetValue ( $scriptParameter ; 2 ) ]
If [ $action = "Print Report" ]
       //Print Report
Else If [ $action = "Save Report" ]
       //Save Report
End If

This is just one example of how these two features can be used together to create a powerful, efficient report tool. These enhancements open up a variety of new possibilities for integrating advanced functionalities into your FileMaker solutions, making your workflows more productive and streamlined.

Conclusion

With FileMaker 2024's new features, including PSOS with Callback and Configure Local Notifications, you can take your development to the next level. So dive in, explore, and start creating amazing solutions today! Contact us at DB Services if you have any questions or need help with your FileMaker solution.

Did you know we are an authorized reseller for Claris FileMaker Licensing?
Contact us to discuss upgrading your Claris FileMaker software.

Download the FileMaker PSOS with Callback File

Please complete the form below to download your FREE FileMaker file.

First Name *
Last Name *
Company
Email *
Phone *
FileMaker Experience *
Agree to Terms *
katie knauss headshot.
Katherine Knauss

Katie is a creative and reliable application developer who keeps her cool under pressure and focuses on results. She is a life-long learner and strives to inspire her teammates with her creativity, dedication, and positive attitude.