Bug Fix: Repeating Events Part 2

Support, Questions and Suggestions for the FM7 Version of CC Calendar.
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Wed Sep 15, 2004 5:12 am
Overview
When selecting a repeating event from the Day, Week, or Month view, the calendar is actually selecting the first of that event's repetitions, not the repetition you selected.

This only applies to the Pro and Pro Dev Versions of CC Calendar for FileMaker Pro 7 prior to version 5.33.

Reproduce the Bug
Navigate to Wednesday August 6th, 2003 on the daily view of the calendar. Create a new appointment and select it to repeat weekly, on Wednesday, for 3 repetitions. Click "Save Repeat Settings" and "Continue" to create your new events. Click "Continue" again to return to the daily view. You have have repeating appointments through August 9th. Navigate to August 8th on the Daily view and select the repeating appointment you just created. Look at the appointment's date on the mini window- it is actually August 6th, the date of the first repetition in this series.

Fix the Bug
To fix this bug we'll remove a few lines from one script and add a couple lines to anther. First, find the following lines in the "Edit Appointment" script in CCCalendar.fp7 (these lines are toward the end of the script.

Code: Select all
#If the Appointment is one of a series of repetitions, make those the found set.

If [ not IsEmpty (AppointmentsDaily::ApptKeyRepeatIDX) ]

  Go to Related Record [ From table: "AppointmentsDailyRepeating"; Using layout: <Current Layout> ] [ Show only related records ]

End If


Delete all four lines.

Next we'll edit the script "Show / Hide / Select Repetition" in CCCalendar.fp7 Here is how the script looks without modification:

Code: Select all
#If there are repeating appointments to show...

If [ not IsEmpty ( AppointmentsDailyRepeating::CommonOne ) ]

   If [ Get ( ScriptParameter ) = "Show" ]

      Set Field [ CalendarDaily::CalRepeatSelectApptIDXGlob; AppointmentsDaily::PrimeApptIDX ]

      Go to Layout [ "Mini Window Show Repetitions" (AppointmentsDaily) ]     

      Adjust Window [ Resize to Fit ]

   Else If [ Get ( ScriptParameter ) = "Select" ]

      Freeze Window

      Set Field [ CalendarDaily::CalRepeatSelectApptIDXGlob; AppointmentsDailyRepeating::PrimeApptIDX ]

      Go to Related Record [ From table: "AppointmentsDailyRepeating"; Using layout: <Current Layout> ]

   Else

      Go to Layout [ "Mini Window Edit Appointment" (AppointmentsDaily) ] 

      Adjust Window [ Resize to Fit ]

   End If

End If


We're going to remove the first "Go to Layout" step. Then, we'll introduce one new "Go to Related Records" step above the first set field step so that the new script looks like this:

Code: Select all
#If there are repeating appointments to show...

If [ not IsEmpty ( AppointmentsDailyRepeating::CommonOne ) ]

   If [ Get ( ScriptParameter ) = "Show" ]

      Go to Related Record [ From table: "AppointmentsDailyRepeating"; Using layout: <unknown> ] [ Show only related records ]

      Set Field [ CalendarDaily::CalRepeatSelectApptIDXGlob; AppointmentsDaily::PrimeApptIDX ]

      Adjust Window [ Resize to Fit ]

   Else If [ Get ( ScriptParameter ) = "Select" ]

      Freeze Window

      Set Field [ CalendarDaily::CalRepeatSelectApptIDXGlob; AppointmentsDailyRepeating::PrimeApptIDX ]

      Go to Related Record [ From table: "AppointmentsDailyRepeating"; Using layout: <Current Layout> ]

   Else

      Go to Layout [ "Mini Window Edit Appointment" (AppointmentsDaily) ]

      Adjust Window [ Resize to Fit ]

   End If

End If


Note the "Using layout: <unknown>" in our new "Go to Related Record" step. The word "unknown" results from a display bug in FileMaker 7's ScriptMaker. When defining that script step you'll actually specify the layout called "Mini Window Show Repetitions", but the ScriptMaker will continue to display "unknown".

Behavior Change
This bug fix will slightly change the way the "show / hide repetitions" buttons work. With this modification in place, clicking "show" in the "show / hide repetitions" button on the edit appointment mini window will take you to the first of that appointments selected repetitions before showing you all the related repetitions. This first appointment will be highlighted, so you'll know that you may have left the record you were on to visit the first repeating record.

That's it!
John Sindelar
SeedCode

Return to CC Calendar (FM7/8)

Who is online

Users browsing this forum: No registered users and 2 guests

(855) SEEDCODE
[email protected]
Follow us: