
Running the Plugin on the Server
When running the plugin on the server, there are some logical limitations and considerations to keep in mind:
Dialog Functions: Functions that present dialogues are not functional when running on the server. These functions are designed for user interaction and are not suitable for server-side execution.
Calculation Limitations: All FileMaker calculations performed from inside ACF functions follow the same limitations as ordinary calculations. This means you should be aware of the server's calculation capabilities and avoid complex or resource-intensive operations.
To run the plugin on the server, you need to register the plugin and load the ACF binaries of your compiled ACF functions. This registration process should be performed only once and not with every Perform Script on Server (PSoS) operation. Since multiple PSoS processes can run on the server concurrently, reloading the ACF binaries during an ongoing process can lead to issues or interruptions in functionality.
To avoid unnecessary reloading of ACF binaries, you can use a simple method:
- Create a basic ACF function like this:
function AreWeLoaded()
return "Yes";
end
- At the beginning of your PSoS script, check if the ACF binaries are already loaded using the
AreWeLoaded
function:
If [ ACF_run("AreWeLoaded") ≠ "Yes" ]
Set Variable [ $reg ; Value: ACF_RegisterPlugin( "Company"; "License data..." ]
Go to Layout [ “Preferences” (Preferences) ; Animation: None ]
Set Variable [ $$ACF ; Value: Let( [ v = If (not IsEmpty ( Preferences::ACF_Pack1) ; ACF_Install_base64Text( Preferences::ACF_Pack1 ); "") ..........
End If
This method ensures that the ACF binaries are loaded only when necessary, preventing unnecessary reloads and potential issues with concurrent PSoS processes.
Access Mode for the Plugin on the Server:
Follow FileMaker's instructions for installing the plugin on the server, and make sure to set the access mode correctly to allow loading and execution:
# Open terminal
cd /path/to/Server/extensions/directory
chmod g+wrx <filepath>
Note: On Windows servers, ensure you use the 64-bit version of the plugin, which is named ACF_plugin.fmx64 and is included in the download package.