Applicable Versions: Full and Pro.
In many cases, it will be easier to simply modify the appointments table that comes with CC Calendar. However, if you have a complex appointments file that already has a lot of work in it, you may wish to point CC Calendar at that file instead. To do this you’ll accomplish a couple basic tasks. First, you’ll define a file referennce for the file containing your appointments file and add the calculation fields, from our appointments table to the table to your file. Then, you’ll point CC Calendar at your file by editing its File References, and Relationships. Lastly, you’ll tidy up a few things by reviewing a few layouts and scripts in CC Calendar.
Experienced FileMaker developers will be able to do this pretty quickly by simply looking at the Relationship Graph for CCCalendar.fp7 and the field definitions for the appointmens table. Even so, the checklist below might be of help.
1. Backup your files. Also, if you're working with the Pro Version you'll be editing some complicated scripts when it comes to re-pointing the repeating events script. Before you get started we suggest you print all CCCalendar.fp7 scripts to a PDF that you can refer back to while you're working. Printing the Relationship Graph and Field Definitions as PDFs is also prudent. While you'll have the original files as backup, it is easier to refer to PDFs while you're working.
2. Prepare your Appointments File. You'll need to make sure that you appointments file has a few basic fields used to relate appointments to the calendar. Note that you're fields don't have to be named the same as ours, but it can help to use the same names as all our documentation (and the Q & A on our support forums) refer to these field names. You'll need at least the following fields in your appointments file:
Start = ApptDateStart ; End = ApptDateEndCalc ];
MinuteStart = (GetAsNumber ( ApptDateStart )-1) 24 60 + Int(GetAsNumber ( ApptTimeStart )/60) ; MinuteEnd = (GetAsNumber ( ApptDateEndCalc )-1) 24 60 + Int(GetAsNumber ( ApptTimeEndCalc )/60) ];
3. Create a File Reference for Appointments. To point the calendar at your appointments table, you'll add a file reference for your appointments table; to keep it simple, name the file reference “Appointments” for now. Go to File / Define / File Reference. Click “New” and then click the “add file“ button to add a line for your appointments file.Note: Do not rename the table occurrences in CCCalendar.fp7
3.1 Adding a File Reference to Your Appointments File (Pro Only). The repeating events? feature requires a few items be added to your appointments file. Aside from ApptKeyRepeatIDX mentioned above these are really cosmetic but they make working with repeating events easier. Define a file reference for CCCalendar.fp7 in your appointments file, calling it "CCCalendar". Then place two table occurrences on the relationship graph in your file (you don't need any relationships to these TOs, just place them on the graph).
From the table "Interface", create a TO called "Interface Globals".
Now return to step 2 above and define the field ApptRepeatHighlightCalc.
4. Re-Point Relationships on the Graph in CCCalendar.fp7. Select File / Define / Database from the File menu and select "Relationships" so that you can see the relationships graph. You'll want to edit all the relationships between the Calendar (in blue) and Appointments (in Green) file. There are a lot of these, but they all follow the same basic format. Lets look at the first one: check out the relationship between Calendar Daily (in blue) and Appointments Daily (in Green). This is in the "Daily Views" section. Double click on the "X" between these table occurrences to edit the relationship. You'll want to select each line where there is an "unknown" field and select the correct field in your appointments table. While your fields may have different names, the relationship definition should look like this:
AND CalLinkUserCalc = ApptKeyUserCalc AND CalLinkUserHideCalc <> ApptKeyUserCalc AND CalLinkTypeCalc = ApptKeyTypeCalc (Pro Only) AND CalLinkTypeHideCalc <> ApptKeyTypeCalc (Pro Only)
You'll need to do this for every green Table Occurrence in the graph. Fortunately, the left hand sides of these will all be fine, but you'll need to re-point the right sides. Be careful and take your time.
4.1 Hour Relationships (Pro Only). The hour relationships (used for Time Display) in the Daily and Weekly sections use Date/Time fields instead of Date fields, so hour relationships look like this:
AND CalLinkUserCalc = ApptKeyUserCalc AND CalLinkUserHideCalc <> ApptKeyUserCalc AND CalLinkTypeCalc = ApptKeyTypeCalc AND CalLinkTypeHideCalc <> ApptKeyTypeCalc
5. Edit the Layouts. Your fields likely don't line up with the fields in our apointments table, so once your new relationships resolve, you'll need to edit the calendar layouts to make sure the correct fields show up in the correct places. Be sure to edit fields on each of the following layouts: Daily, Week. Month, Search, Mini Window Edit Appointments, and MiniWindow Show Repetitions (Pro Only).
6. Edit Scripts. While you don't need to create any scripts in your appointments file, you do need to edit a few scripts in CC Calendar that set specific fields in the appointments table. As with layouts, your fields may not line up exactly with the original fields. Check the following scripts in CCCalendar (these scripts are thoroughly commented to make this process easier):
8. That's It!