paramNamecorresponds to the
nameof an input in the HTML form, which may differ from the label for the field as it appears on-screen. The paramName should match the
nameattribute on the
<input type="text" name="my_input">input element in the HTML source code.
In addition to field inputs, you can specify files to upload to a form using the WAUploadFileAtURL function.
Again, the inputName should match the
name attribute on the
<input type="file" name="my_upload"> in the HTML source code.
You can specify multiple parameters or file uploads. They will all be sent the next time the WAGetURL function is called.
For more advanced users, there is the option of setting the content of the request manually, using the WASetRawPostData function.
This will be sent as-is in the request, which is useful if (for example) the
POST data should contain an XML document instead of key/value pairs. You are responsible for encoding this information correctly, as it will be sent as-is to the URL.
Let ( setup = WAReset & WASetInputValue( "first_name" ; "Sam" ) & WASetInputValue( "last_name" ; "Barnum" ) & WASetInputValue( "email" ; "firstname.lastname@example.org" ) ; WAGetURL( "http://example.com/test/signup.php" ) )
To get an image from a password-protected website, just use the following calculation:
Let ( setup = WAReset ; WAGetURL( "http://example.com/images/logo.jpg" ; "username=bob123", "password=secretpass" ; "type=container" ) )
To upload files to a web form, pass container data to the
WASetInputValue function, or a URL to the
Let ( setup = WAReset ; WASetInputValue( "upload1" ; Products::picture_container ) & WAUploadFileAtURL( "upload2" ; "file:///Users/sam/Pictures/header.jpg" ) ; WAGetURL( "http://example.com/upload.php" ) )
WAConfigure("proxyHost", settings::proxyHost) and WAConfigure("proxyPort", settings::proxyPort)Do this in your startup script, and any further connections will go through your proxy host.
When something unexpected happens, the plug-in will pop up a dialog showing what the error message is. This makes it easy to see what went wrong.
However, in some cases, you (the developer) may prefer to show your own message to the user, or possibly not show a message at all.
In that case, you can call
WASetErrorCapture with a parameter of true. That will suppress the error dialog from appearing to the user.
When you call this function, it is set for that plug-in for as long as FileMaker is running, so if you want to do all of your own error handling, you can just set it to true once in your startup script. However, we recommend only turning it on when your script is prepared to check for errors, and then turning it off after finishing that section.
Whether or not you suppress the error dialogs, a plugin function will return the word
ERROR if something goes wrong. It's a good idea to put your plugin functions in an 'If' statement so that you don't execute a bunch of script steps after something has gone wrong. If you'd like for your script to get the error message, you can get that by calling the
Here is an example of basic error reporting:
Set Variable [ $result = MyPluginFunction("x" ; "y" ; "z") ] If [ $result = "ERROR" ] Exit Script[ "Error occurred: " & WALastError ] Else ... do more stuff here ... End If
Since the string
"ERROR" evaluates to false when evaluated by FileMaker, and most plugin functions return a
1 when successful, you can chain multiple dependent plugin operations together using the
However, in this case the result will be a
1 or a
"ERROR". For example:
// chain multiple calls together // if any of the functions fail, the calculation will // short-circuit with a result of
false, // and none of the subsequent function calls will be evaluated. Set Variable [ $success = FirstPluginFunction("x") and SecondPluginFunction("y") and ThirdPluginFunction("z") ] If [not $success] Show Custom Dialog [ "An error occurred: " & WALastError ] End If
Note: the above only works for plugin functions which return
1 on success! Check the documentation for each function used in this manner.
If a plugin is not installed correctly, calls to a plugin function will return "?". As part of your startup script, you should check for this occurrence and display a warning accordingly that the plugin needs to be installed. Note: when treated as a boolean true/false value, FileMaker will treat
FileMaker version 11 or higher.
Java Virtual Machine (JVM) version 1.6 or later (32-bit). If you are running a JVM earlier than 1.6, you should upgrade.
Download a JVM from http://www.java.com/en/download/. Apple has a 32-bit version of Java 1.6 here
If you are not sure what version of Java you have installed, you can do
java -version on the command line in Windows or OS X.
Windows, or Mac OS X version 10.6 or higher.
Note to intel Mac users: running this plugin under Rosetta is not supported. Upgrade to FileMaker 8.5 to run our plugin in native Intel mode.
Drag the plugin from the MAC or WIN folder into your FileMaker extensions, and restart FileMaker.
If the plugin does not load correctly, double-check that you meet the system requirements.
You do not need to do this step unless you plan on using the plugin with Instant Web Publishing with FileMaker Server Advanced. You will need an Enterprise license to use this feature.
For installing into the Web Publishing Engine with FileMaker Server or FileMaker Server Advanced, drag the plugin from the MAC (.fmplugin file) or WIN (.fmx file) folder
FileMaker Server/Web Publishing/publishing-engine/wpc/Plugins folder. If there is no
Plugins folder inside the
wpc folder, then create it manually.
Restart FileMaker Web Publishing, and now the plugins should be ready to go.
The easiest way to test whether the plugin is working is to have a calculation which calls the version function of the plugin, and display that on an IWP layout. If it shows "?", then the plugin is not working. If it shows a number, then the plugin has been installed successfully.
If you are using FileMaker Server 12.0v1 or earlier, you can follow the same procedure as detailed above for custom web publishing. However, in FileMaker Server 12.0v2 and later, the custom web publishing now runs as a 64-bit application, and requires a slightly different location. You will need an Enterprise license to use this feature.
For Mac, the single plug-in file in the MAC directory contains both 32-bit and 64-bit versions. For Windows, look for the plug-in that has the extension .fmx64 and use it in exclusively in custom web publishing.
To install 64-bit plug-ins, install either the .fmx64 or the .fmplugin to the following directory:
FileMaker Server / Web Publishing / publishing-engine / cwpc / Plugins
If it does not exist, create the Plugin folder manually. Restart FileMaker Web Publishing, and then you can then test a script that contains a plug-in and see if it returns the correct values.
Please note that plug-ins do not work with the web publishing engine of the Mac version of FileMaker Server 8.0v4.
You do not need to do this step unless you plan on using the plugin with scheduled script triggering. You will need an Enterprise license to use this feature.
/Library/FileMaker Server/Database Server/Extensionsfolder. On Windows, this is at
C:\Program Files\FileMaker\FileMaker Server\Database Server\Extensions.
Configuration -> Database Server->Server Plug-insand check the box that says 'Enable FileMaker Server to use plug-ins', and then check the 'enabled' box for this plugin. Click the 'save' button and wait a few seconds to make sure that the 'enabled' check box stays checked. If it does not, then there was an error loading the plugin and you should contact us for help troubleshooting. You should now be able to write schedules that trigger scripts which use the plugin.
360Works has created an AutoUpdate helper database which makes setting up Auto Update much easier. This file includes pre-configured plugin files which you can place on your server, and an auto-update script for each of our plugins which you can paste into your own solution.
You can get the AutoUpdate360Works file at fmp7://autoupdate.360works.com/AutoUpdate360Works or fmp://autoupdate12.360works.com/AutoUpdate360Works. Follow the instructions included in the file to either host your own Auto Update server or pull the files from ours.
Plugins will run in demo mode until they are registered. While running in Demo mode, the product will run for 2 hours every time you launch FileMaker / FileMaker Server / FileMaker Web Publishing Engine. The 2 hour time limit will reset every time you relaunch FileMaker. There is no expiration date when Demo mode stops working. There are no feature differences between the Demo version and the licensed version.
Once you have purchased the plugin, you can register it with the license key. Once a valid license key is entered, the product will run for as long as FileMaker is running. After FileMaker starts up with the plugin installed, open FileMaker preferences, click on the Plug-ins tab, select the plugin from the list, and click the Configure button. Enter your license key and company name in this dialog. You will only need to do this once on a given machine. Alternately, you can use the registration function to register the plugin during a startup script.
Note that if you are running the plugin with FileMaker Server / FileMaker Web Publishing Engine, you must use the registration function to register the plugin, since there is no preferences dialog on FileMaker Server to enter the license key and company name.
We love to hear your suggestions for improving our products! If you are experiencing problems with this plugin, or have a feature request, or are happy with it, we'd appreciate hearing about it. Send us a message on our website, or email us!
SO_TIMEOUT) in milliseconds which is the timeout for waiting for data. A timeout value of zero (the default value) is interpreted as an infinite timeout.
optionName- the optionName to set.
value- the value of the optionName.
headerName- the name of the HTTP header to fetch
name, or null if no such header was found.
POSTrequest. Otherwise, a
GETrequest is used to get the contents of the URL.
You can also use this to get the contents of files on your local machine, using the following syntax:
If the content type of the returned data is text, this function returns the text. Otherwise, a container is returned. Alternatley, you can specify a type to return the URL content as, using the
type parameter (see Optional Parameters below).
You can optionally supply a username and password, for accessing password-protected content. This must be passed in with each request, as the values are cleared out after doing the request.
Set Variable [ $xml = WAGetURL( "http://myservice.com" ; "username=bob" ; "password=secret" ; "type=text" ) ]
url- the location of the file to get.
optionalParameters- optional parameters
nullif there was no error.
Calling this function will scan the
HTML parameter text for the form identified by the
For every input element in the specified
form, WASetInputValue will be called with the corresponding inputName and value.
html- block of HTML code containing one or more
whichForm- the optional id, name, or index of the form to use. If omitted, the first
<form>will be used.
licenseKey- a valid license key string, or the literal string "DEMO" to run in demo mode.
registeredTo- the company name for the license key used.
charset- a character set name, for example
errorCapture- set to true to suppress the default popups.
WASetInputValue( "email" ; Contacts::emailAddress )
To send a container field as an attachment, pass the container field as the
WASetInputValue( "photo" ; Contacts::portrait )
If you want to upload the contents of a local file or URL instead of a container, use the WAUploadFileAtURL function instead.
You can call this function multiple times before sending a form. If called twice with the same inputName, this will _not_ overwrite the previous value, but will send both values.
inputName- the unencoded name of the form input
value- the unencoded value text, or a container to send as an upload.
GETarguments instead of
You cannot combine this with calls to WAUploadFileAtURL in the same request.
You can call this function multiple times before sending a form.
dataToPost- raw encoded POST data to send in the next request.
headerName, and the cookie data as the
headerName- the name of the HTTP header to set
value- the value of the HTTP header
html- some HTML.
If you want to upload the contents of a container field instead of a URL, use the WASetInputValue function instead, passing the container as the
inputName- the input name to associate with this file.
url- URL pointing to a file to upload. This can be a local file (
file:///path/to/file) as well as a remote URL (