SetAppointmentProperties

Posted by: fsegui on 7 March 2021, 2:03 pm EST

    • Post Options:
    • Link

    Posted 7 March 2021, 2:03 pm EST

    Hello,

    I’m trying to update the appointmentproperties with the SetAppointmentProperties method.

    I wanted to know when we can call this method, so far, I cannot make it work.

    I’m using a custom form to create/update an event.

    When the user is validated the custom form, I’m updating the appointment properties like this:

    m_pEditingEvent.BeginEdit()
    			StartTime = DateFromString((dtpStartDate.Value), (cmbStartTime.Text))
    			EndTime = DateFromString((dtpEndDate.Value), (cmbEndTime.Text))
    

    But it does not work for the xml.

    And I’ve not seen any implementation in the documentation nor in the examples.

  • Posted 8 March 2021, 5:00 am EST

    Hi,

    The SetAppointmentProperties is used to set properties like RecurrencePattern, Reminder, Labels, etc. from an XML string which you can generate using GetAppointmentProperties. If you want to set properties like subject, start end, and end date from XML you can use the FromXml method of the appointment which reconstructs appointment from XML. If you want to persist the change made to the appointment in the program, you need to resave the XML content after the changes have been made. Please refer to the sample attached which demonstrates SetAppoinmentProperties and FromXml. If you meant something else, please provide a sample and GIF showing the issue so that we can investigate this further.

    Regards.

    Avnish

    SchedulerXML.zip

  • Posted 8 March 2021, 6:05 am EST

    Hello,

    I want to add some custom properties in the AppointmentProperties.

    When I add the appointment to the appointment storage, I then get the xml properties with the GetAppointmentProperties method and add some properties of my own.

    If Not Calendar.DataStorage.AppointmentStorage.Appointments.Contains(m_pEditingEvent) Then
    				Calendar.DataStorage.AppointmentStorage.Appointments.Add(m_pEditingEvent)
    
    				Dim test As Boolean
    				test = m_pEditingEvent.SetAppointmentProperties("<AppointmentProps><AllDayEvent>True</AllDayEvent><BusyStatus Id=""00000000-0000-0000-0000-000000000000"" Index=""-1"" />
      <Label Id=""00000000-0000-0000-0000-000000000000"" Index=""-1"" /><hasDoc>1</hasDoc><util_login>V8</util_login></AppointmentProps>")
    
    			End If
    

    I’m always getting false.

  • Posted 10 March 2021, 1:35 am EST

    Hi,

    Please note, you can not save custom data for appointments like that. If you want to save some custom information with the appointment, you can use the CustomData property of the Appointment, it is serialized with other appointment properties into AppointmentProperties XML. Please refer to the sample attached.

    Also, you can refer to the “Implementing CustomData” section of the blog at https://www.grapecity.com/blogs/customizing-scheduler-for-custom-data.

    Regards.

    Avnish

    SchedulerXML_mod.zip

  • Posted 11 March 2021, 12:26 pm EST

    Hi,

    Ok I’ll use CustomData to handle my specific properties.

    In fact, it’ll be easier (no need for XML in this case)

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels