Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic GetFreePeriod difficulties (Read 2098 times)
mnanderson
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: Jul 18th, 2006
GetFreePeriod difficulties
Nov 26th, 2009 at 4:58pm
Print Post  
Is there some trick to using Schedule.GetFreePeriod?
I'm trying to use it to automatically fill a schedule with non-overlapping Appointments, but I end up with many Appointments scheduled into the same time periods. There is definitely free space available in the schedule.

Any ideas? I can post code, if that would help.


Thanks,

Mark
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: GetFreePeriod difficulties
Reply #1 - Nov 26th, 2009 at 7:06pm
Print Post  
Hi,

Have you added the new appointment to the schedule before calling GetFreePeriod for the next one, and if using grouping, have you also added the respective resource to the appointment's resources collection?

Stoyan
  
Back to top
 
IP Logged
 
mnanderson
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: Jul 18th, 2006
Re: GetFreePeriod difficulties
Reply #2 - Nov 26th, 2009 at 8:12pm
Print Post  
Hi all,

Turns out (unsurprisingly) that the problem was mine; GetFreePeriod was working fine, but I once I had found the free period, and added a new Appointment into the free timeslot, I set the StartDate of the Recurrence property of the newly scheduled item to be a value BEFORE the free period, thus booking multiple items into the same period.

Problem solved.

Thanks for the prompt reply anyway, Stoyo. Smiley

Mark
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint