1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
| Quintiq file version 2.0
| #parent: #root
| Method ChangeDurationOfEvent (
| MacroPlan macroplan,
| String calendarid
| )
| {
| TextBody:
| [*
| // Get the UnitCalendar
| unitcalendar := select( macroplan, Unit.UnitCalendar, uc, uc.CalendarID() = calendarid );
| // Get the events of unit calendars
| unitcalendarevent := unitcalendar.Event( relget );
|
| traverse( unitcalendarevent, Elements, event )
| {
| event.Update( event.Subject(),
| event.Description(),
| event.Type(),
| event.Capacity(),
| event.IsDefault(),
| event.StartTimeOfDay(),
| event.EndTimeOfDay(),
| Duration::Days( 2 ), // Change duration to 2 days
| event.IsAllDay(),
| false );
| }
| *]
| InterfaceProperties { Accessibility: 'Module' }
| }
|
|