Hi,
I not sure how to explain it, so I'll just share my solution.
In the Axtive control initialisation I have this code.
AX_Calendar>>SetDataProvider("Provider=Custom")AX_Calendar>>DataProvider>>Open()
ActiveXEvent("LP_AXC_DoRetrieveDayEvents",AX_Calendar,"DoRetrieveDayEvents")
In the LP_AXC_DoRetrieveDayEvents Procedure I have this code
PROCEDURE LP_AXC_DoRetrieveDayEvents(dtDay , lPEvents=AX_Calendar>>CalendarEvents)
ldtNdate is DateTime = dtDay
pautevent is object Automation dynamic
pautevent = new object Automation "Codejock.CalendarControl.12.1.1"
IF NOT gbCalQueryDone
gbCalQueryDone=HExecuteQuery(QRY_Calendar,hQueryDefault,gsOwnerID)
END
Ldtendate is DateTime = Left(ldtNdate,14)
Ldtendate ..Hour+=23
Ldtendate ..Minute +=59
FOR ALL QRY_Calendar WHERE "QRY_Calendar.StartDate>='"+ldtNdate+"' AND QRY_Calendar.EndDate <='"+Left(Ldtendate,14)+"'"
pautevent = AX_Calendar>>DataProvider>>CreateEventEx(QRY_Calendar.CalendarID)
pautevent>>StartTime=QRY_Calendar.StartDate
pautevent>>EndTime=QRY_Calendar.EndDate
pautevent>>Subject=QRY_Calendar.Subject
pautevent>>Location=Calendar.Location
pautevent>>Body=QRY_Calendar.Description
IF QRY_Calendar.IsMeeting <> 0 THEN
pautevent>>MeetingFlag = True
ELSE
pautevent>>MeetingFlag=False
END
IF QRY_Calendar.Private <> 0 THEN
pautevent>>PrivateFlag = True
ELSE
pautevent>>PrivateFlag = False
END
pautevent>>Label = QRY_Calendar.LabelID
pautevent>>BusyStatus = QRY_Calendar.BusyStatus
pautevent>>Importance = QRY_Calendar.ImportanceLevel
IF QRY_Calendar.Alldayevent<>0 THEN
pautevent>>AllDayEvent=True
ELSE
pautevent>>AllDayEvent=False
END
IF QRY_Calendar.IsReminder <> 0 THEN
pautevent>>reminder = True
ELSE
pautevent>>reminder = False
END
pautevent>>reminderMinutesBeforeStart= QRY_Calendar.ReminderMinutesBeforeStart
pautevent>>reminderSoundFile = QRY_Calendar.ReminderSoundFile
pautevent>>Customproperties>>loadfromstring(QRY_Calendar.CustomPropertiesXMLData)
pautevent>>CustomIcons>>LoadFromString(QRY_Calendar.CustomIconIDs)
pautevent>>ScheduleID = QRY_Calendar.ScheduleID
IF brException THEN
pautevent>>MakeAsRException
pautevent>>RExceptionStartTimeOrig = QRY_Calendar.RExceptionStartTimeOrig
pautevent>>RExceptionEndTimeOrig = QRY_Calendar.RExceptionEndTimeOrig
IF QRY_Calendar.IsRecurrenceExceptionDeleted <> 0 THEN
pautevent>>RExceptionDeletedTrue = True
ELSE
pautevent>>RExceptionDeletedTrue = False
END
END
IF NOT brException THEN
pautevent>>CustomProperties("process_RecurrenceState") = QRY_Calendar.RecurrenceState
pautevent>>CustomProperties("process_RecurrencePatternID") = QRY_Calendar.RecurrencePatternID
END
lPEvents>>add(pautevent)
END
gwb LoadCal=True
AX_ DatePicker>>RedrawControl()
I load each event into an object then call the the add event method, seems to work OK, I haven't been able to recurring events tpo work yet though.
Regards
Mark
|