SeedCodeCalendar

Integration

These are the docs for our FM10/11 version of the Pro Calendar. Docs for the newer, FM12 version of our calendar can be found here.

Integration Options.

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.

If you don't need to have the calendar "in" your file, you can still link the two files, pointing the calendar at your events table instead of the SampleEvents table it comes with. Linking in this way is much faster but means you'll have two files instead of one. (The chief disadvantage of this is that you have to have the same accounts and passwords in each file, unless you set the calendar file to auto-open with its own low access password for everyone.)

If this sounds like it might be for you, follow our instructions for the Quick Integration.

Step-by-Step Instructions: Pasting SeedCode Calendar into your File.

1. Backup your file.

Really.
And this is important: review a couple of things you may want to change in your file before you get started.
If you want to use the Sample Events table in SeedCode Calendar as your events table, instead of a table you already have, just import it into your file in step 2 below and skip step 5.
Lastly, while it may be tempting for some of you to open your file in one version of FileMaker and ours in another, to make copying and pasting a little faster, this will actually cause problems when the scripts are brought over. So while the calendar works great in FM10 or FM11, do the integration work in one version or the other: don't copy and paste between them.

2. Fields.

2.1 Add two new calculation 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:
Case (
Self = Time ( 24 ; 0 ; 0 ) ; Time ( 24 ; 0 ; 1 ) ;
Self = Time ( 0 ; 0 ; 0 ) ; Time ( 0 ; 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.
2.3 Now add the following Auto-Enter Calculated Value option to the TimeEnd field in your events table:
Case (
Self = Time ( 24 ; 0 ; 0 ) ; Time ( 24 ; 0 ; 1 ) ;
Self = Time ( 0 ; 0 ; 0 ) ; Time ( 0 ; 0 ; 1 ) ;
Self > Time ( 24 ; 0 ; 0 ) ; Self - Time ( 24 ; 0 ; 0 ) ;
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.
2.4 Add more one new field to your event's table from SeedCode Calendar's Sample Events table:
Repeating_ID

3. Tables.

Import three tables into your file from SeedCode Calendar: CalendarRows, CalendarInterface, and CalendarColors. (If you're using data separation, add these tables to your interface file.)
If you're using FileMaker Advanced, you can just copy and paste the three tables. If you don't have Advanced, from your file select File / Import Records... / File and then select the SeedCodeCalendar file. Select the first of the three tables to import and for the target, select "New Table". FileMaker will create the new table and calcs for you but you'll have to come back and uncomment some of the calcs that couldn't find the items needed: come back after you've imported all three tables this way and remove the leading /* and trailing */ form your calcs.
If you don't have Advanced, and that sounds like too much, we'd be happy to complete this step for you, just send us your file.

4. Value Lists.

Open SeedCode Calendar and recreate the 7 value lists from our calendar in your file. Feel free to use your list of statuses and resources, but rename them to the names we're using in SeedCode Calendar: you can name them back later. The other values lists need to stay as they are, though you can feel free to change the time formats in "Calendar Times" to suit your tastes. You might want to do that later though, once you have this up and running.
Here, and in what follows, you don't need to import anything to do with SampleContacts or SampleProjects as you'll likely already have these things in your file. That is, you likely have a method of selecting contacts and projects and will want to use your existing method on the Event Details layout. (However, even if you do, creating Contacts and Projects values lists now will let the Event Detail layout find those value lists when you paste the layout into you file. (We also use this Projects value list on the calendar's filters: another good reason to create them now.)

5. Table Occurrences.

Select File / Manage / Database and navigate to the Relationships tab where you can see the "relationship graph" for your file. Click the little green plus button in the lower left to 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.
If you have a separate table of contacts you can create a new table occurrence of that as well and name it "SampleContacts" (again, with no quotes or spaces in the name). Link this to the SampleEvents table occurrence you just created using the same field matching you use elsewhere: this is likely from the SampleEvent's contact ID to the unique ID of the contact in SampleContacts.

6. Relationships

6.1 Relationships Part 1. Staying on the Relationships tab, link "CalendarRows" to "CalendarInterface" to "CalendarColors" as shown below. Double check that the table occurrence names match what we have in the sample file.
At this point, if you want to show event colors in list view as we do in the Event List or Event Detail layouts, copy our field "z_ColorCalc" from Sample Events and add it to your events table. Remove the /* and */ from the beginning and end of the calc and replace our use of the field "status" with the equivalent field in your events table: this is the field we used to color code events in the calendar.
6.5. Relationships Part 2. The gantt chart was introduced in version 5.6 of the calendar. If you're not using the gantt chart you can skip this section.
If you'll be using the Gantt Charts you'll want to connect a few more things in the graph. First, create a relationship from CalendarRows to SampleEvents like this:
CalendarEventUIDCalc_FirstValue = _id
Where _id is the primary key (the unique ID) in your events table. Then attach SampleEvents to your Contacts, Projects, and possibly your Phases table occurrences, as shown here:
It probably make sense to create new instances of these to attach to SampleEvents, but you don't have to. You may, however, want to rename your table occurrences to "Sample..." for now so that items pasted in later will line up. If you don't have a Phases table, don't worry; phases are completely optional.
Once your section of the graph looks like ours above, you can create a couple new fields in your Projects table, and in your Phases table if you're using Phases.
In Projects create the calc "ProjectDateEarliestEventCalc" returning the type Date equal to: Min ( SampleEvents::DateStart )
Also in Projects create the calc "ProjectDateLatestEventCalc" returning the type Date equal to: Max ( Max ( SampleEvents::DateEnd ) ; Max ( SampleEvents::DateStart ) )
In Phases (if you're using Phases) create the calc "PhaseDateEarliestEventCalc" returning the type Date equal to: Min ( SampleEvents::DateStart )
Also in Phases create the calc "PhaseDateLatestEventCalc" returning the type Date equal to: Max ( Max ( SampleEvents::DateEnd ) ; Max ( SampleEvents::DateStart ) )
Finally, in SampleEvents, create a new number field called "z_LinkedWithinProject"

7. Layouts Part 1.

Create a few blank layouts in your file. (We'll paste in 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 in the layouts menu, all these layouts are required). This is most easily done by creating the first layout listed below, deleting the header and footer part, and duplicating it to create the others. Create the layout and then visit Layout Setup and uncheck the box beside "Show field frames when record is active". Also uncheck the box to enable QuickFind if you're using FileMaker 11. (If you want to search the calendar using QuickFind you can leave this enabled on the EventList layout, or use fmSearchResults to extend QuickFind. Do this after you've followed these instructions and are up and running.) Keep duplicating and renaming layouts making sure to switch "Show records from" to match the associated table shown in the list below.
Again, you don't need to add the contact layouts unless you don't have any of your own.
You may want to create the separator layouts we have as well (these are based on CalendarInterface) but that is just cosmetic. Make sure each layout is based on the table occurrence shown below.
Once you're done, go through and make sure these layouts have exactly the same names as the ones in SeedCode Calendar, and that the headers and footers are deleted from each.
Finally, 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.
However, if any scripts are reported as being "renamed" because of a conflict, quickly scan the imported scripts for names ending "2" and correct them. For example, the calendar has a script called "Upon Opening". If you already have one with that name ours will get imported as "Upon Opening 2". To fix this rename yours to something like "Upon Opening Main" and then rename ours to "Upon Opening". Our scripts must have the same names as they do in the SeedCode Calendar file for the following step to work.
If you're using the gantt chart, edit the script "Record Gantt Chart Field Names..." and follow the instructions in each SetVariable line to point the script at the Project and Phase fields in your tables. Some lines may already be correct if you've named your fields the same way we have. You may need to create a couple of fields in your Project's table, and create the field "z_LinkedWithinProject" in SampleEvents if you haven't already. While Phases aren't required-- you can skip the phase fields if you're not using phases, all 3 project fields and the one field from SampleEvents mentioned in this script are required.

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. Do every layout, including Calendar Rows and Calendar Color Records. 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 following 3 objects: the "repeat" button, the "show repts..." button below it, and the large "close..." button at the bottom of the screen. You can come back and edit this layout later, for now, just get the Summary, Date, and Time fields lined up with the relevant fields in your events table.
Just as you needed to click on fields on Event Details and point them at the proper fields in your table, you'll need to do the same to the Event List layout and to the Gantt Chart tab of the Calendar layouts. If you're not using the gantt charts, skip on to step 10.
Navigating to the gantt tab means moving one of our button bars: you'll find notes about how to get to this here: working with the calendar tabs.
On the gantt tab you only need to edit the three fields to the left of the vertical black line. These fields are stacked on top of each other, so click on the top one, dragging it down and out of the way: hold the shift key down while dragging to you don't move the field to the left or right. Do this again with the next field until your layout looks like this:
It doesn't matter in which order you drag the fields, but you'll point them at their correct fields in your table starting with the one that is furthest to the left (that is the lowest one in the illustration above). Point that field at the name of your Project in SampleProjects. Point the next field in from the left at your Phase's name from SamplePhases if you have phases: if you don't have phases, delete the field. Finally point the one starting furthest to the right at the Summary field in your Sample Events table. Then move the two fields back up to their original positions.

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 (in Browse and Find Mode)
Script: "Load Calendar Layout"
(Do this on each of the four calendar layouts.)
Layout: Event Details (1 trigger)
Trigger: OnRecordLoad (in Browse Mode)
Script: "On Event Record Load"
Return to the Calendar Home layout when you're done and enter Browse Mode.

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.
If you're using the gantt chart, edit the script "Sort FileMaker Records for Gantt Chart..." following the instructions in the script's comments.
Edit the script "Create Edit Delete Event..." and you'll see a few fields "missing". Point these at the fields in your events table with the same name. You can tell which field to use from the names of the variable we're setting into them.
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 to create a multi-line event display.
A couple tips:
Events with just a single date should have a start date: if your event has just an end date the calendar will fail. The same goes for times: if there is only one time, make it the start time.
Don't use calcs for things like the dates, times, or resources. The calendar wants to edit these values when you drag items around, and it can't edit calcs. Use auto-enter calculations instead if you must.

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. If you're using multiple windows or renaming windows in your own upon opening script, you may want to run our Upon Opening routine the first time your users open the calendar in a new window rather than at the beginning.

13. Run a Script.

That's it. Run the script "Upon Opening" script and you should see your events in the day view.

Enjoy!

(855) SEEDCODE
[email protected]
Follow us: