Integrating the Free Calendar: Linking It
There are two ways to get the free calendar to work with your file. You can paste it into your FileMaker file (instructions follow below), or you can "link" it to your file.
Linking keeps the calendar running in a separate window, but it's the fastest way to get things working together.
You can learn how to do this by watching a short movie...
...where we do the whole thing in < 7 minutes (while talking slowly). If you'd rather have the calendar IN your file, read on...
Adding SeedCode Calendar Free to your File: Pasting It In
Most folks will paste SeedCode Calendar into their file and use an events table they already have for the events they want to see in the calendar. These instructions are for them. If you want to use the Sample Events table in SeedCode Calendar as your events table, just import it into your file in step 2 below and skip step 5.
1. Backup your file.
And this is
important: review a
couple of things you may want to change in your file before you get started.
2. Fields.
2.1 Add two new fields to your event's table from SeedCode Calendar's Sample Events table:
z_sc_TimestampEndCalc
z_sc_TimestampStartCalc
Edit the definitions for these calcs, removing any leading / trailing comment tags if you pasted the fields in using FileMaker Advanced (that is, remove the /* and */ from the beginning and end of the calc. Then replace the DateStart, TimeStart, etc. fields in these calculations with the relevant fields from your events table. Make sure both calcs return the form "timestamp" and that both are indexed.
2.2 Next, add the following Auto-Enter Calculated Value option to the TimeStart field in your events table:
If ( Self = Time ( 24 ; 0 ; 0 ) ; Time ( 24 ; 0 ; 1 ) ; Self )
Make sure you uncheck the "Do not replace existing value" checkbox. This Auto-Enter option is needed if you want events to be able to start at midnight.
3. Tables.
Import two tables into your file from SeedCode Calendar: CalendarRows and CalendarInterface. If you were ever wondering why people bought FileMaker Advanced, this is why. If you don't have Advanced we'd be happy to complete this step for you, just send us your file.
4. Value Lists.
Open SeedCode Calendar and recreate the one "Yes No" value list from our file in yours.
5. Table Occurrences.
Create a new occurrence of your events table (the table that has the records you want to see on the calendar) and name it "SampleEvents" (make sure there are no spaces in the table occurrence name). You can change this name later.
6. Relationships.
On your relationship graph, link "CalendarRows" to "CalendarInterface" as show on the graph in SeedCode Calendar. Double check that the table occurrence names match what we have in the sample file.
7. Layouts Part 1.
Create a few blank layouts in your file. (We'll paste in the content for these layouts in a subsequent step.) You'll create one layout in your file for each layout in SeedCode Calendar (even though only some layouts are visible to users, all these layouts are required). Layouts are either based on Calendar Rows, Calendar Interface, or Sample Events. Once you're done, go through and make sure these layouts have exactly the same names as the ones in SeedCode Calendar, and delete the headers and footers from each of them.
You may want to create the separator layouts we have as well (these are based on Calendar Interface) but that is just cosmetic.
Delete the default layouts created when you imported tables in step 3.
Now you may already have layouts you want to use for your Event List and Event Details. If so, take a moment to read about that here: using
your own Event layouts.
8. Scripts.
Import the scripts from SeedCode Calendar. When importing, just click the check box beside the folder "SeedCode Calendar" and all the scripts within that folder will import. There will be a number of errors reports when you import: this is normal. In "Setup" below we'll remap some of the fields and settings in these scripts to values in your file.
9. Layouts Part 2.
Now copy the layout contents from each layout in SeedCode Calendar and paste them into the layout of the same name in your file. And yes, we do need the contents of "Calendar Records" on that layout. The contents of "Developer" are optional. You'll be warned that you'll be increasing the size of each layout; that's OK.
When you get to Event Details feel free to edit this layout as you see fit, adding your own fields and buttons. Just be sure to keep the large "close..." button at the bottom of the screen.
10. Layout Script Triggers.
Assign script triggers. Since layout level script triggers don't come over when you copy and paste layout elements, you'll have to recreate these. Fortunately there are only a few.
Layout: Calendar (1 trigger)
Trigger: OnRecordLoad - "Load Calendar Layout" (browse mode and find mode)
(Do this on each of the four calendar layouts.)
Layout: Event Details (1 trigger)
Trigger: OnRecordLoad - "On Event Record Load"
11. Setup.
11.1 Configure the calendar. Edit the script "Load Calendar Settings - On Startup..." and follow the comments changing values as necessary.
11.2 Sort your records. Edit the script "Sort FileMaker Records..." and follow the instructions to sort your records by date / time ascending, editing the sort step there to use fields from your events table.
11.3 Map your data. Then go to the layout "Source No 1" and follow the directions on the layout to map the fields there to the fields in your SampleEvents table. Map the "Summary" to a simple field for now like your event's title, just to get you up and running, then return here and try mapping the summary to something more interesting.
12. Clean Up.
Rename your Sample Events table occurrence to something that makes more sense for you. And add the script "Upon Opening" to your file's opening script, removing the go to layout stuff if you'd like.
13. Run a Script.
That's it. Run the script "Upon Opening" script and you should see your events in the day view.
Enjoy!