Recently, I’ve discovered a way of sending and receiving data to a hosted database on FileMaker Server without hard coded file references using the FileMaker Script Protocol. This may come in handy if you have applications with remote users over the WAN and the server may change. Here’s the basic technique:
- You can use insert from URL with xml to get the data for a record on the server (be sure to use SSL if you are going to use an account in the URL string). For example:
"http://user:pw@serveraddress/fmi/xml/fmresultset.xml?-db=opportunity.fmp12&-lay=webOpportunity&__kp_OP_ID=" & opportunity::__kp_OP_ID & "&-find"
- Parse the results of the insertURL script step and put them into a scratch table. You can now compare the local data with data on the server.
- You can update the results on the server by passing parameters with the FileMaker script parameter using something like this:
"FMP://user:pw@yourserver/opportunity.fmp12?script=UpdateDataFromRemote¶m=<kp>" & opportunity::__kp_OP_ID & "</kp>" & $fields
- In FielMaker go, you can then update the scratch table with the new contents from the server by calling a local FileMaker script with parameters:
"FMP://~/opportunity.fmp12?script=SetFromWeb¶m=" & $$fields
Has anyone else been using the FileMaker script parameter like this? How well has it worked for you?