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.

Featured Replies

  • Newbies

I am running the following script on my FileMaker Server:

It works 99% of the time, but every once in a while, it will not work (due to server overload or the plugin getting disabled)

What I would like to do is to catch when an error occurs and send note to me that something went wrong. I tried adding the following two scripts steps (separately, not at the same time) after running the Set Variable and they did not do anything. 

1. If [$result = "ERROR"]

2. If [get(LastErrorMessage)]

These were the steps suggested on the 360Works website. Is there another idea that may work?

 

 

Hi jzhess88,

I would first recommend that you do not chain all of your function calls with "and" inside the one set variable script step. It is better practice to have them called in separate set variable calls. The way you have it now if one function in the chain fails, the entire script step will fail. Once you break them out into their own set variable calls, you will be able to trap for errors for each function call and be able to tell where the error is coming from. The first option is the correct way to trap for errors in this instance. The second option would be for if you were calling the functions as script steps (only available in FM16). I would write the script as follows:

Set Variable [$result; Value: EmailRegister( "LicenseString"; "Registered To" )]
if[$result="ERROR"]
//however you want to handle error.
End If

Set Variable [$connect; Value: EmailConnectSMTP( "Hostname" ; "Emailaddress" ; "password" )]
if[$connect="ERROR"]
//however you want to handle error.
End If

Set Variable [$create; Value: EmailCreate( $EventEmail; $ToEmail; $EmailSubject )]
if[$create="ERROR"]
//however you want to handle error.
End If

Set Variable [$body; Value:EmailSetBody( $EmailBody; "html" )]
if[$body="ERROR"]
//however you want to handle error.
End If

Set Variable [$cc; Value: EmailCCRecipients( $CCEmail )] 
if[$cc="ERROR"]
//however you want to handle error.
End If

Set Variable [$bcc; Value: EmailBCCRecipients( $BCCEmail )]
if[$bcc="ERROR"]
//however you want to handle error.
End If

Set Variable [$send; Value: EmailSend]
if[$send="ERROR"]
//however you want to handle error.
End If

Set Variable [$disconnect; Value: EmailDisconnect]

Also, looks like your email password has been redacted while I was writing this response but it is probably a good idea to change your password.

  • Author
  • Newbies

Thank you ryan360Works, I did what you said and separated each step out and had the if statements exactly as you have them. Inside the if statements, I simply added the send mail script step to send a plain text email to myself.

I then disabled the 360works plugin on my server and ran the script to see if it would catch any errors. Unfortunately, it did not. 

Do you have any other suggestions of what I can do?

Disabling the plugin will not result in "ERROR" but rather a "?". A better test would be to put non-sense/incorrect credentials in the EmailConnect function call or just bad data into any of your parameters for any function call that would result in an error. 

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.