Scheduling multiple appt dates for one appointment

Support, Questions and Suggestions for the FM7 Version of CC Calendar.
PostPosted: Sat Nov 26, 2005 5:21 pm
I recently purchased the new scheduling program. I need to have two dates scheduled per appointment. I created a field that automatically calculates the second date based on the appointment date that is manually entered. How do I get the second date scheduled with the same resource/description, etc? (i.e, I am tracking court dates and input the actual hearing date as the appointment. However, I also need to input the day the court report is due (10 days prior to the court hearing). I created an auto calculate field to generate the date but can't figure out how to schedule it.)

I love the program but really need to figure this out so that I can track due dates easier.

Thanks.
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Sun Nov 27, 2005 8:51 am
Thanks for your post.

I think you'll get more out of the calendar if you create a second appointment for the Report's Due Date, rather than make a second date field within the original appointment. Fortunately, you don't have to create this second appointment by hand. You can automate it.

Here is how I'd do this...

1. Create a New Script

This is the script that will cerate your second appointment (the one for the Court Report being due). We'll use some of the Repeating Events structures to link this second appointment to the oringinal hearing. Create the following new script called "Create Related Appointment":

Code: Select all
Commit Records/Requests
Set Field [ AppointmentsDaily::ApptKeyRepeatIDX; AppointmentsDaily::PrimeApptIDX ]
Duplicate Record/Request
Set Field [ AppointmentsDaily::ApptTitle; "Court Report Due: " & AppointmentsDaily::ApptTitle ]
Set Field [ AppointmentsDaily::ApptDateStart; AppointmentsDaily::ApptDateStart + 10 ]
Set Field [ AppointmentsDaily::ApptEndDate; "" ]
Set Field [ AppointmentsDaily::ApptTimeEnd; "" ]
Set Field [ AppointmentsDaily::ApptTimeEnd; "" ]
Set Field [ AppointmentsDaily::ApptType; "Report Due" ]


Note that the first SetField links the two appointments as if they were repeating events. This means that from either appointment you can click "show repetitions" and you'll see the two appointmennts together. Very handy as it lets you easily look at the original hearing's record from the Court Report Due record. The second SetField includes the title of the original appointment in the Report Due title. If your original appointment is titled something like "Case XYZ" your related appointment will be called "Court Report Due: Case XYZ". The remaining set field simply adjust your date to 10 days in the future and clear out any hearing times that may have been in the oiginal appointment.

Finally, our last SetField changes the appointment type. I'm assuming you're using Type to differentiate "hearings" from deadlines, meetings, and other appointments.

1. Edit the "Continue" Script

Now edit the "Edit Appointment - Continue" script so that we automatically create a Report Due record when creating a hearing record. The "Edit Appointment - Continue" script contains the comment "Create repetitions if necessary" about half way down. After the "Else" following that comment, add three new lines- If, PerformScript, and EndIf - so that section of the script now looks like this:

Code: Select all
#Create repetitions if necessary.
If [ Count ( AppointmentsDailyRepeating::PrimeApptIDX ) = 1
// There is only 1 related record, the selected appoitment related to itself by virtue of its ApptKeyRepeatIDX being set to its own PrimeIDX ]
    Perform Script [ “Create Repetitions” ]
Else
    If [ AppointmentsDaily::ApptType = "hearing" and IsEmpty ( AppointmentsDailyRepeating::PrimeApptIDX ) ]
        Perform Script [ “Create Related Appointment” ]
    End If
    Close Window [ Name: Get ( ScriptParameter ) ]


Note that the test in our new If statement asks if AppointmentsDaily::ApptType = "hearing". I'm not sure how you're indicating which appointments are "hearings" but using the appointment type would be one way. if you're doing something else, just replace that part of the test with something that makes sense for you: something that will only give "hearings" a Report Due date, so you don't end up with appointments like "Court Report Due: Pickup Dry Cleaning."

The second part of this If statement... "and IsEmpty ( AppointmentsDailyRepeating::PrimeApptIDX )" ...prevents Report Due records from being created twice for the same hearing, even if the hearing record is edited several times. The Report Due record will thus only be created when an appointment of the type "hearing" is edited and that appointment does not yet have a Report Due record.

I'm sure you'll have to modify this a bit for your own situation, but I hope it helps get you started.
John Sindelar
SeedCode

Return to CC Calendar (FM7/8)

Who is online

Users browsing this forum: No registered users and 2 guests

cron
(855) SEEDCODE
[email protected]
Follow us: