CCCalendar

Integration Free

Free Version: How can I use my own Appointments file in the Calendar?

Applicable Versions: Free.

Swapping out a New Appointments table: Free Version

In many cases, it will be easier to simply modify the CCCalAppts table that comes with CC Calendar. However, if you have a complex appointments table 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 add the calculation fields, from the CCCalAppts table of CCCalendar.fp7 to your file. Then, you’ll point CC Calendar at your file by editing the calendar’s 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 in the CCCalAppts table. Even so, the checklist below might be of help.

1. Backup your files.

2. Prepare your Appointments table. You'll need to make sure that your appointments table has a few basic fields used to relate appointments to the calendar. Note that your 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. While you may want a few things like start time and end time, you'll need at least the following fields in your appointments table:

ApptDateStart - the date your appointment begins.
ApptEndDate - the date your appointment ends.
ApptDateEndCalc - this calc is used to fill in an End Date for you appointments if one does not exist. If your appointments never last more than 1 day, you can edit this calc to simply use the StartDate of the appointment, or dispense with this field and use ApptDateStart in its place in calendar relationships. Note, that as the calc is presently written, it creates and end date for appointments that cross midnight. Again, if your appointments never cross midnight, you can simplify or dispense with this calc and with ApptEndDate.
ApptKeyDateRangeCalc - this is a complicated calc but with FM7’s “let” function you can almost just paste this into your table. Simply replace the two fields in the let statement with your versions of “ApptDateStart” and “ApptDateEndCalc”. The only part of this calc that you’ll edit is the beginning...
Let ( [

Start = ApptDateStart ; End = ApptDateEndCalc ];

ApptUser - To keep CC Calendar simple, we relate appointments to people based on the person's initials. Formatting your data entry for a user's initials as a checkbox easily lets you record multiple users per appointment, which CC Calendar supports.
ApptKeyUserCalc - This calculation simply adds a "-" to the end of your list of users' initials for a given appointment.

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.

4. Re-Point Relationships on the Graph. Select File / Define / Database from the File menu and select "Relationships" so that you can see the relationships graph. You'll want to edit the relationship between Calendar Daily (in blue) and Appointments Daily (in Green). First, you’ll want to redirect the Appointments Daily table from the table which shipped within CCCalendar.fp7 to the appointments table in your file. Double click on AppointmentsDaily and in the specify file dialog presented switch the file from CCCalendar.fp7 to the file reference you just created; select your appointments table but DO NOT allow the table occurrence to be renamed. When you select your table FileMaker will attempt to rename the table occurrence with the name of your table: be SURE to retype “AppointmentsDaily” as the table occurrence name. Click “OK” in the specify file dialog. Now that your fields appear in the Appointments Daily table occurrence, 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:

CalDateKey0 = ApptKeyDateRangeCalc

AND CalLinkUserCalc = ApptKeyUserCalc AND CalLinkUserHideCalc <> ApptKeyUserCalc

Further down in the graph you’ll see the table occurrences for the month view where there are 7 relationships between the calendarmonthweek table occurrence (in blue) and 7 appointment occurrences in green. Each of these relationships looks like the one described above with the exception of the first field on the left hand side. The first relationship uses CalDateKey0 , the second CalDateKey1, then CalDateKey2, etc. Each of these need to be pointed at the table in your new file reference (without renaming the table occurrences) and have their relationships edited as described above.

5. Edit the Layouts. Your fields likely don't line up with the fields in CCCalAppts, 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, Month, Mini Window Edit Appointments.

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):

New Appointment: Check the two set field statements. They should set your versions of ApptKeyDateStart and ApptKeyUser respectively. The script should end with a GotoField step going to your ApptTimeStart field.
Edit Appointment: Just check that the last line uses a GotoField step going to your ApptTitle field.

7. That's It!

(855) SEEDCODE
[email protected]
Follow us: