Hello,
My goal is to keep an archive of past appointments placed on the calendar that can be kept up to date when appointments are added, removed or updated on the calendar.
What I would like to do:
Upon appointment Insert
- Capture the ID
- Create a new table with the ID, start and end times and other data necessary for the archive A new row would need to be inserted for each recurrence in the appointment as well should it be recurring.
Upon appointment update
- Use the ID to find all future occurences in the archive table and delete them
- Create new entries in the archive table for all future occurences (same as the insert)
Upon delete
- Delete all future occurences of the appointment in the archive table.
As you can see I want to leave anything that happened historically in place so it can be evaluated later and not affected by changes in the future.
I believe I can add the functions but here are the hurdles I'm facing:
1) I am returning the inserted ID from the insert query in a variable, how do I access that in the appointmentinserted event?
2) There are no recurrence details in the e.appointment variable that I can see, just the pattern. How do I access the recurrence items so I can loop through them and add them to the calendar? in the appointmentinserted and updated events? Do I have to select them using the id into a new object?
I know I saw a post similar to this here a while back, but now I cannot find it. Any tips would be appreciated. Thanks!!! - Andrew
My goal is to keep an archive of past appointments placed on the calendar that can be kept up to date when appointments are added, removed or updated on the calendar.
What I would like to do:
Upon appointment Insert
- Capture the ID
- Create a new table with the ID, start and end times and other data necessary for the archive A new row would need to be inserted for each recurrence in the appointment as well should it be recurring.
Upon appointment update
- Use the ID to find all future occurences in the archive table and delete them
- Create new entries in the archive table for all future occurences (same as the insert)
Upon delete
- Delete all future occurences of the appointment in the archive table.
As you can see I want to leave anything that happened historically in place so it can be evaluated later and not affected by changes in the future.
I believe I can add the functions but here are the hurdles I'm facing:
1) I am returning the inserted ID from the insert query in a variable, how do I access that in the appointmentinserted event?
2) There are no recurrence details in the e.appointment variable that I can see, just the pattern. How do I access the recurrence items so I can loop through them and add them to the calendar? in the appointmentinserted and updated events? Do I have to select them using the id into a new object?
I know I saw a post similar to this here a while back, but now I cannot find it. Any tips would be appreciated. Thanks!!! - Andrew