/ Forums / Advansys Formativ / Creating Solutions with Formativ / Create a new accepted appointment

  • Creator
    Topic
  • #4221
    kempf
    Participant

      Hi, i want to create an appointment in my own calendar which should be automatically accepted.

      It’s no problem to create an appointment, but i can’t find any possibility to accept this appointment

      Here is the code (i use Groupwise 7):

      set oDraft = GroupWise.Account.MailBox.Messages.Add(“GW.MESSAGE.APPOINTMENT”, fgwDraft)
      call oDraft.Recipients.Add(“anyone@blabla.com”, “”, fgwTo)

      oDraft.Subject=”Subject…”
      oDraft.StartDate=sStartDate
      oDraft.EndDate=sEndDate
      oDraft.AlarmSet=true
      oDraft.AlarmReminderMinutes=10

      ‘Version 1:
      call oDraft.Accept(“CRM inserted/changed appointment!”,210,NewMsg.messageid,true)
      set NewMsg=oDraft.Send()

      ‘Version 2:
      set NewMsg=oDraft.Send()
      call oDraft.Accept(“CRM inserted/changed appointment!”,210,NewMsg.messageid,true)

      ‘Version 3:
      set NewMsg=oDraft.Send()
      Groupwise.ItemAccept(“inserted/changed appointment)
      or
      Groupwise.ItemAccept(“inserted/changed appointment”,210,”” & NewMsg.messageid & “”,0)

      ‘Version 4
      set NewMsg=oDraft.Send()
      iSyntax = “ItemAccept(“”inserted/changed appointment””;210;””” & NewMsg.messageid & “””;0)”
      msgbox groupwise.throwtoken(iSyntax, returnVal)

      …what every i try, the appointment is never accepted. Whats wrong?

      The next problem is, that i can’t set the Alarm. I tried:
      oDraft.AlarmSet=true
      oDraft.AlarmReminderMinutes=10

      but nothing happens. Isn’t it possible to set the Alarm parameters before sending the appointment?

      Thanks for your help

    • Author
      Replies
    • #7528
      Support 3
      Participant

        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

        #7530
        kempf
        Participant

          Ahhhh, thats it…. Smile

          Now i understand…

          Thanks for you quick help

          #7529
          Support 2
          Moderator

            Thanks for the feedback. Great to hear that the information was helpful.

            Regards,

            Advansys Support

          Viewing 3 replies - 1 through 3 (of 3 total)
          • You must be logged in to reply to this topic.