Appointmentadded event: key returns guid, not id

Posted by: fsegui on 7 October 2020, 8:54 pm EST

    • Post Options:
    • Link

    Posted 7 October 2020, 8:54 pm EST - Updated 3 October 2022, 2:35 pm EST

    Hello,

    I’ve bound appointments to my database through the smart designer like this:

    When a new appointment is added, I try to get the eventid like this but it returns the guid.

    Dim eventId As Integer = Val(eventArgs.Appointment.Key(0))
    

    One things that is weird:

    when loading the schedule, I’m filling info from database and it raises each time the appointmentadded event. in this case, I get the eventid and not the guid.

  • Posted 8 October 2020, 10:41 pm EST

    Hi Florent,

    As said in the given link, the array always contains a single object. It can be either an System.Int32 or System.Guid value depending on which one is actually used for binding this data. For example, if you bind AppointmentStorage to the database and set IndexMapping, this property will return an System.Int32 value. If you set IdMapping, this property will return a System.Guid value.

    https://www.grapecity.com/componentone/docs/win/online-schedule/C1.Win.C1Schedule.4.5.2~C1.C1Schedule.BasePersistableObject~Key.html?highlight=key%2C

    So if you have set the Index mapping then it should return an integer value.

    Can you please share your dummy data with which you are facing the issue at your end so that we can test the same at our end and forward it further for investigation?

    Regards,

    Prabhat Sharma.

  • Posted 8 October 2020, 11:53 pm EST

    Hi,

    Here is a backup from the database with dummy events. Hope it’s enough.

    calendarevents.zip

  • Posted 12 October 2020, 5:58 pm EST

    Hi Florent,

    We too can observe the issue at our end and escalated it to the developers.

    We will let you know once we get any update on this from their end.

    [Internal Tracking ID: 466997]

    Regards,

    Prabhat Sharma.

  • Posted 12 October 2020, 6:01 pm EST

    Hi Prabhat Sharma,

    Thanks for your feedback, I’ll wait for the developers’ update.

    BR,

  • Posted 14 October 2020, 9:05 pm EST

    Hello Florent,

    When adding the DataSource please make sure that the eventid Column’s AutoIncrement property is set to True, and AutoIncrementSeed and AutoIncrementStep values to something different from -1:

    Please find the attached sample implementing the same.

    Regards,

    Prabhat Sharma.

  • Posted 14 October 2020, 9:07 pm EST

    Here is the sample attached.Schedule1.zip

  • Posted 14 October 2020, 10:50 pm EST

    Hi Prabhat Sharma,

    Thanks for your feedback, works fine now.

Need extra support?

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

Learn More

Forum Channels