A Homegrown Week Calendar Via 7 FileMaker Portals

From Dwayne Wright PMP
Certified FileMaker Developer

WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

Please Note: If you are viewing this page in a news feeder, the images may get munged up a bit or other formatting of the posting may fail. For the best experience, please visit the journal directly by clicking (here)

In this example, we show you how to build a calendar view of a weeks worth of appointments. Like with most things FileMaker, it's not that hard to create if you break it down into a series of smaller steps.

What we've done is create a layout that has seven portals that will show the appointments for each day of the week. Above and to the right of each portal, is a View button that will take the user to a list view of those days records ( via GTRR ).

The key to all the portals is a reference date, used from a global field called evaluation date. From this data, the corresponding days ( Sunday through Saturday ) are calculated and are used a parent key fields in their associated portals.
We start off by figuring the Sunday of the week for any given date. We first covered this in our Guide To FileMaker Calculations and Functions.

evaluation_date - (DayofWeek(evaluation_date) -1)

I'll explain this a bit before moving on, lets start by saying the evaluation date is Friday 6/13/2003. That means the DayofWeek function will return a 6. So it looks like

6/13/2003 - ( 6 -1 ) which really means...

6/13/2003 - 5 which really means...

6/8/2003 ... which is the Sunday of that week.

To get the rest of the days ( Monday through Satuday ) add a one to the last value.

MONDAY - evaluation_date - (DayofWeek(evaluation_date) -2)
TUESDAY - evaluation_date - (DayofWeek(evaluation_date) -3)
WEDNESDAY - evaluation_date - (DayofWeek(evaluation_date) -4)
THURSDAY - evaluation_date - (DayofWeek(evaluation_date) -5)
FRIDAY - evaluation_date - (DayofWeek(evaluation_date) -6)
SATURDAY - evaluation_date - (DayofWeek(evaluation_date) -7)

Then we simply create a portal using each of these fields as a parent key for that day. You can get quite a bit more elaborate by creating calculated key fields for a person's employee id, a particular appointment type or just about anything.

An example file can be downloaded by clicking (here).
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2008 - Dwayne Wright - dwaynewright.com

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.