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.

How can send Email birthday by automatically through filemaker server 18?

Featured Replies

Hi All,

As per mentioned on topic I Would like ask someone to help me this issue because I am trying more than time unfortunately all is not successful to send e-mail for birthday in case have in the same day more than one employee.birthday.thumb.png.13ae26f9e6ccb1af9a05ed6e392824cf.png

 

on filemaker server :

 

1474416913_filemakerserver.thumb.png.cc895a46160a0a476c7ea4c0510a5b83.png

This makes the assumption that the field "Birthday::C_Birthday" has a format of mm/dd/year:  

Allow User Abort [ Off ]
Set Error Capture [ On ]
Go to Layout [ Birthday List ]

    Set Variable [ $bdate_find; Value:
    Let ( [
    ~bday = Day ( Get (CurrentDate));
    ~bmonth = Month ( Get (CurrentDate))
    ];~bmonth&"/"&~bday&"/*" ) ]


Perform Find [ Specified Find Requests: Find Records; Criteria: Birthday::C_Birthday: “$bdate_find” ][ Restore ]


If [ Get (LastError)=401 ]
    Exit Script [ ]

Else

    Go to Record/Request/Page[ First ]
    Loop

        Send Mail [ Send via SMTP Server ][ No dialog ]
        Go to Record/Request/Page[ Next; Exit after last ]
    
    End Loop
End If
Exit Script

Edited by Jim Gill

  • Author

Thank you is working perfect...

Two side notes:

1. You can find people whose birthday is today, regardless of the date format in use, by:

Enter Find Mode [ ]
Set Field [ Employees::DateOfBirth; Substitute ( Get (CurrentDate) ; Year ( Get (CurrentDate) ) ; "*" ) ] 
Perform Find [ ]   

2. If you run such script on a daily basis, you will miss people whose birthday falls on a weekend or holiday. In addition, people born on February 29 will be skipped in 3 out of 4 years.

 

Edited by comment

  • Author

thanks a lot for clarification, how can skip this issue people born on February 29 will be skipped in 3 out of 4 years.?

If you intend to run this daily, then you need to make sure that if today is February 28 in a non-leap year, the search will find people born on February 28 as well as people born on February 29. That means setting the searched date field to something like:

Let ( 
today = Get (CurrentDate) 
;
If (
DayOfYear ( today ) = 59 and Month ( today + 1 ) = 3 ;
Substitute ( Date ( 11 ; 22 ; 3333 ) ; [ "11" ; "2" ] ; [ "22" ; "{28..29}" ] ; [ "3333" ; "*" ] ) ;
Substitute ( today ; Year ( today ) ; "*"  )
)
)

 

---
P.S. Do people still appreciate getting an automated birthday greeting?

  • Author

 

Where I put this calculation ?

Actualy yesterday I try very thing working fine.

4 minutes ago, Msaeed said:

Where I put this calculation ?

Here:

Enter Find Mode [ ]
Set Field [ Employees::DateOfBirth; «CALCULATION GOES HERE» ] 
Perform Find [ ]  

 

4 minutes ago, Msaeed said:

Actualy yesterday I try very thing working fine.

Not sure what you mean by that. Yesterday was not February 28 in a non-leap year.

 

Edited by comment

  • Author

I will try to change the date and update you asap.

 

  • 2 weeks later...

@Comment

On 10/10/2020 at 3:47 AM, comment said:

Enter Find Mode [ ]

Set Field [ Employees::DateOfBirth; Substitute ( Get (CurrentDate) ; Year ( Get (CurrentDate) ) ; "*" ) ]

Perform Find [ ]

I'm not a developer (just love FMP - ehh Claris) - curious why the three steps and not just the single step? So replace the quoted above with this:

Perform Find [ Specified Find Requests: Find Records; Criteria: Employees::DateOfBirth; Substitute ( Get (CurrentDate) ; Year ( Get (CurrentDate) ) ; "*" ) ][ Restore ]

Appreciate your insight!

Because you cannot perform calculations in a find request.

You could - if you wanted - reduce this to two steps by using a variable. But the 3-step method has the advantage of showing exactly what's going on without requiring the reader to examine the find requests.

 

Edited by comment

Got it!  Thank you for the enlightenment - totally makes sense now that you have said it.  You probably just saved me at least an hour of frustration in some future scripting endeavor!  Thanks again!!

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.