/ Forums / Advansys Formativ / Creating Solutions with Formativ / Create a new accepted appointment / Reply To: Create a new accepted appointment
Hi kempf,
If you want to create an appointment to your calendar then you should create posted appointment. No need to send the appointment to yourself and later accept the appointment. I don’t think you can automatically send and accept an appointment. See the example code below to create a posted appointment with alarm time:
set oGWAppt = groupwise.account.calendar.messages.Add(“GW.MESSAGE.APPOINTMENT”, fgwPersonal)
oGWAppt.OnCalendar = TRUE
oGWAppt.StartDate = now
oGWAppt.EndDate = DateAdd(“d”, 1, date)
oGWAppt.Subject.PlainText = “Test appointment”
oGWAppt.Place = “Office”
oGWAppt.BodyText.PlainText = “Appointment body”
oGWAppt.AlarmSet = true
oGWAppt.AlarmReminderMinutes = 20
set oGWAppt = nothing
However, if you want to accept an incoming appointment then you have to use the Token API. The example code below uses the Token API to accept a selected appointment. See Formativ language Guide for more information about ThrowToken method.
set oMsg = client.clientstate.commandmessage msgbox groupwise.throwtoken("ItemAccept(""Review required"";160;""" & oMsg.messageid & """;)", returnVal) set oMsg = nothing
Hope this helps.
Regards,
Advansys Support