Run scripts via Data API with FileMaker Plugins
If [ Position ( Get(ApplicationVersion) ; "Data API" ; 1 ; 1 ) > 1 ]
# forward call to Server Scripting Engine
Perform Script on Server [ Specified: By name ; Get(ScriptName) ; Parameter: Get(ScriptParameter) ; Wait for completion: On ]
Exit Script [ Text Result: Get(ScriptResult) ]
End If
Exit Script [ Text Result: "MBS: " & MBS("Version") & ", Server: " & Get(ApplicationVersion) ]
As you see we forward parameter and get back the result. So without the trick with the if block, we get back from the script:
"MBS: ?, Server: FileMaker Data API Engine 18.0.1"
and with the if loop and our forward:
"MBS: 10.0.0.9, Server: Server 18.0.1"
And you can use MBS Plugin on the server via Data API.
We recommend to check LastError via Get(LastError) function call after Perform Script on Server to see if you got "Hosts capacity exceeded" with error number 812. In that case it may be good idea to make a 10 second script pause and try again.
PS: See also product idea: Support plugins in Data API