Edit repeating follow-ups
•
Version: 10
Some tooltip text!
• 1 minute to read
• 1 minute to read
You can change either one or all future repetitions of a recurring follow-up.
Change one repetition
Change only this instance, the change will not affect other times.
Postponing the current follow-up by 2 hours:
Integer aId = 234;
NSAppointmentAgent appointmentAgent;
NSAppointmentEntity a = appointmentAgent.GetAppointmentEntity(aId);
NSRecurrenceInfo r = a.GetRecurrence();
if (r.GetIsRecurrence()) {
r.SetStartDate(r.GetStartDate().addHour(2));
newAppointment.SetRecurrence(r);
newAppointment = appointmentAgent.SaveAppointmentEntity(newAppointment);
}
Change all future repetitions
Change all future instances including this one - the change will apply to this follow-up in the future as well.
Integer aId = 234;
DateTime now;
NSAppointmentAgent appointmentAgent;
NSAppointmentEntity a = appointmentAgent.GetAppointmentEntity(aId);
NSRecurrenceInfo r = a.GetRecurrence();
if (r.GetIsRecurrence()) {
NSAppointment[] appointmentList = appointmentAgent.GetAppointmentRecords(0,r.GetRecurrenceId());
for(Integer i = 0; i < appointmentList.length(); i++) {
if (appointmentList[i].GetStartDate().diff(now) > 0) {
NSAppointmentEntity futureAppointment = appointmentAgent.GetAppointmentEntity(appointmentList[i].GetAppointmentId());
// set changes here
futureAppointment = appointmentAgent.SaveAppointmentEntity(futureAppointment);
}
}
}