admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
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
31
32
33
34
35
Quintiq file version 2.0
#parent: #root
Method SubscribeToEvent (
  LibCal_Calendar calendar_i,
  String subject_i,
  Boolean useLeadingPeriod_i
) as LibCal_Participation
{
  Description: 'Let the calendar subscribe to an event from another calendar.'
  TextBody:
  [*
    subscription := null( LibCal_Participation );
    event        := select( calendar_i, Event, evnt, true, evnt.Subject() = subject_i );
    
    if( not isnull( event ) )
    {
      subscription := this.SubscribeToEvent( event, useLeadingPeriod_i );
    }
    else
    {
      if( isnull( calendar_i ) )
      {
        LibCal_Util::Error( "LibCal_Calendar.SubscribeToEvent() : trying to subscribe to event '" + subject_i + "' of an UNKNOWN calendar." +
                            " | CalendarID = '" + calendar_i.CalendarID() + "'" );
      }
      else
      {
        LibCal_Util::Warning( "LibCal_Calendar.SubscribeToEvent() : no event found with subject '" + subject_i + "' in calendar '" + calendar_i.CalendarID() + "'." +
                              " | CalendarID = '" + calendar_i.CalendarID() + "'" );
      }
    }
    
    return subscription;
  *]
}