Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

OnOpen and OnClose Scripts and PHP Clients

Featured Replies

I've just noticed in my FM Server logs the following Publishing Engine Error:

FM Web Publishing - - wpc1 Web Scripting Error: 4, File: "Contacts", Script: "On Close Script", Script Step: "Adjust Window"

I'm familiar with scripts and which script steps are compatible with Web Publishing. However I'm not clear about when either the OnOpen or OnClose scripts that you can set in FileMaker Pro via the File menu > File Options > Open/Close tab are performed with PHP API clients? It appears that my OnClose script is being performed but I haven't setup any script calls in my PHP pages - I know the "Adjust Window" script step is not web publishing compatible, but I didn't realise this script was being performed by the Web Publishing Engine.

My OnOpen script also uses this same incompatible script step but there are no references to this in the logs. Anyone know when the OnOpen and OnClose script steps are being performed as far as Web Publishing via PHP is concerned?

Thanks,

Steve

  • 1 month later...

Presumably when the FileMaker object is created and then on close when the php script concludes or immediately after the command is executed.

I would suggest that you simply determine the client accessing the script and exit the script if you don't want them to run:


If[Left(Get(ApplicationVersion);5)="Server" OR Left(Get(ApplicationVersion);3)="Web")]

Exit Script

End If

I forget if CWP counts as a Web client or not but it will be either Server or Web.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.