/ Forums / Advansys Formativ / Creating Solutions with Formativ / Programmatically accept an appointment / Reply To: Programmatically accept an appointment

#6530
Support 1a
Participant

Thank you for your detailed posting.

Assuming you only wish to modify the properties of posted appointments, you don’t need to clone and send the original. Posted appointments are owned by the current account, which means you are free to modify most of the properties of the appointment directly, including custom field values.

It seems you wish to change the start date and/or duration of the posted appointment. You should be able to update the startdate and duration of the message directly. For example:

Set Msg = Client.ClientState.CommandMessage

Msg.StartDate =
Msg.Duration =

There is no need to call the send method again, or call .Accept, as this is a posted appointment.

Note that this approach will cause the original posted appointment to be moved to the new date/time in the calendar. If for some reason you wish to retain a copy of the original event, then you must use clone. I don’t think that you would need to use the accept method (as this only pertains to non-posted appointments). In either case, you can only call the .Accept method on appointments that have been sent. In your example you are calling .Accept() prior to send, which will result in a security error message being generated.

In summary, if you simply wish to change the date/time of a personal/posted item, just change the appropriate properties of the object directly – there is no need to clone the message.

I hope this helps.

Advansys Support