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

I am a newbie to FileMaker and use Pro 12 Adv with Windows Vista and Outlook 2007. I am creating my first DB and have an email function in it. I have tried with no success to create a script that will only send email if the email address field is populated. It seems that the script is not being looked at and the email will not work at all unless the "Button Setup" has been created.

 

I have tried all the suggestions in the forums and other sites with no success. What am I forgetting?

 

Thanks for all your help.

 

Dave

Solved by dfoliver

Go to solution

Dave,

 

Post the script and you will receive more help - 

 

 It seems that the script is not being looked at and the email will not work at all unless the "Button Setup" has been created.

 

Not sure what you mean by this  :idot:

 

Jim

  • Author

Dave,

 

Post the script and you will receive more help - 

 

Not sure what you mean by this  :idot:

 

Jim

Here it is Jim. Thanks in advance for looking into this.

 

If [isEmpty ( Studios::Studio_eMail )]

   Omit Record

Else

   Send Mail [send via E-mail Client; To: Studios::Studio_eMail]

End If

 

Dave

You nearly had it -

 

From FMP Help:

 

IsEmpty
Purpose
Returns True(1) if field is empty, if a related field, related table, relationship, or file is missing, or if some other error occurs; otherwise, returns False(0).

 

So your script should look like this:

 

If [isEmpty ( Studios::Studio_eMail )] = 1
   Omit Record
Else
   Send Mail [send via E-mail Client; To: Studios::Studio_eMail]
End If

 

Is there more to your script?  This would only work for the current record. If you want to automate this script over multiple records add a loop.

 

Hope this helps!

Jim

  • Author

You nearly had it -

 

From FMP Help:

 

IsEmpty
Purpose
Returns True(1) if field is empty, if a related field, related table, relationship, or file is missing, or if some other error occurs; otherwise, returns False(0).

 

So your script should look like this:

 

If [isEmpty ( Studios::Studio_eMail )] = 1

   Omit Record

Else

   Send Mail [send via E-mail Client; To: Studios::Studio_eMail]

End If

 

Is there more to your script?  This would only work for the current record. If you want to automate this script over multiple records add a loop.

 

Hope this helps!

Jim

Yes. I am only doing this for the active record (at this time).

 

Wow. Thanks.  I had used the "=1", but in all the wrong places!

 

BUT - I can't figure out how to get the  "= 1" AFTER the trailing "]". I can't access in-line statement editing.

 

Dave

 

If [isEmpty ( file::field )]

 

or Not IsEmpty( field )

 

 

maybe technically there some theory,  i am not that bright but....

 

I been using for years...thousands of time, my standard practice,  this format..

 

Have never need tested if  1   or 0

  • Author

If [isEmpty ( file::field )]

 

or Not IsEmpty( field )

 

 

maybe technically there some theory,  i am not that bright but....

 

I been using for years...thousands of time, my standard practice,  this format..

 

Have never need tested if  1   or 0

Thank you Rod. I'll give this a shot and respond with my results.

 

Dave

  • Author

Thank you Rod. I'll give this a shot and respond with my results.

 

Dave

 

Thank you Rod. I'll give this a shot and respond with my results.

 

Dave

 

I tried the IsEmpty route with no results.

 

I am launching the script from clicking an embedded picture. The trigger I am using is OnObjectEnter. Would this be correct?

 

Dave

I've attached a screenshot om my calc dialog box and in this format your script works for me (obviously you need to substitute Table::field).  And you OnObjectEnter trigger should work fine

 

Jim

post-88355-0-83421200-1367250845_thumb.j

  • Author

I've attached a screenshot om my calc dialog box and in this format your script works for me (obviously you need to substitute Table::field).  And you OnObjectEnter trigger should work fine

 

Jim

 

...hmmmm... I am using the same script, but the script trigger is being ignored (or appears to be). Nothing I do in the script is actually being performed. Am I missing something at a more basic level?

 

Dave

Seems your script trigger is not firing - in layout mode be sure the field with the photo/trigger is brought to the front.  You could also set the field up as a Button to perform the script.

  • Author

This is my script that doesn't get triggered (I suppose). Either with or without the "= 1" doesn't work.

The field for the actual email address is formatted as TEXT with no special options set.

The button I press to trigger the script is an image.

<sigh> such a learning curve.

Using the actual field as a trigger works the same as the script (or Button setup).

 

Dave

 

post-108866-0-72853900-1367258765_thumb.

The "=1" is completely unnecessary unless you are using GetAsBoolean.

  • Author

The "=1" is completely unnecessary unless you are using GetAsBoolean.

 

New script. Still does not work however. I've been looking (somewhat feverishly) for a fix. This script only has to work on the current record.

 

Here's the current non-working script.

 

Thanks.  Dave

post-108866-0-04955700-1367271800_thumb.

Since you have Advanced, have you tried stepping through the script with Script Debugger and looking at error messages, and whether another script is being set by a script trigger?

  • Author
  • Solution

Since you have Advanced, have you tried stepping through the script with Script Debugger and looking at error messages, and whether another script is being set by a script trigger?

 

Thank you Doug.

 

Yes I did.  I've been running it all day long - until just now I had no positive results.

 

I just ran the debugger with a "fresh pair of eyes" (I went and cut the grass and ate dinner) and lo and behold - the button was running the wrong script! I had written the one I showed in my previous email, but didn't connect it to the email button <sigh>.

 

Okay then. So I sleep well tonight. :hmm:

 

Thanks for the encouragement Doug, Rick, Jim and Rod.

 

For those who missed the answer I attached it again here for you.

 

Davepost-108866-0-41186400-1367295649_thumb.

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.