Get ID of newly inserted appointment _AppointmentInsert Event

7 posts, 0 answers
  1. Karl
    Karl avatar
    172 posts
    Member since:
    Jun 2009

    Posted 02 Oct 2013 Link to this post

    Is there anyway I can get the id of the newly inserted record on the AppointmentInsert event. I have a sqldatasource and looking to send an email once a new appointment has been created.

    Thanks
  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 03 Oct 2013 Link to this post

    Hello Karl,

    You can follow the approach from the this forum post -> http://www.telerik.com/community/forums/aspnet-ajax/scheduler/getting-id-of-inserted-appointment.aspx

    Despite it is for the XmlSchedulerProvider you can use the approach. Simply inherit the DataSourceViewSchedulerProvider provider instead of the XML one.

    Regards,
    Genady Sergeev
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Karl
    Karl avatar
    172 posts
    Member since:
    Jun 2009

    Posted 04 Oct 2013 Link to this post

    Thanks for the reply, can you tell me the namespace for the DataSourceViewSchedulerProvider

    I've tried Telerik.Web.UI and Telerik.Web.UI.Schedling but can'f find anything?
  5. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 08 Oct 2013 Link to this post

    Hi Karl,

    Sorry for the confusion, my bad. It seems that the correct way to do this is to inherit the DbSchedulerProviderBase and place the send email logic in the overridden Insert method. For your convenience I've prepared a sample project that shows how to inherit DbSchedulerProviderBase. If you take a look at the Insert method I've left a comment that shows where you can send the email.

    Regards,
    Genady Sergeev
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  6. Fadil
    Fadil avatar
    2 posts
    Member since:
    Jan 2014

    Posted 09 Apr 2014 in reply to Genady Sergeev Link to this post

    Has this been made simpler perhaps in the later versions?
    the solution seems to be very convoluted for something that should be simple.
  7. Fadil
    Fadil avatar
    2 posts
    Member since:
    Jan 2014

    Posted 09 Apr 2014 in reply to Fadil Link to this post

    when using SQLDataSource:-
    here is a method you could use to get the newly created ID

    http://msdn.microsoft.com/en-us/library/ie/z72eefad.aspx

  8. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 10 Apr 2014 Link to this post

    Hello Karl,

    Thank you for sharing this useful resource with the community.

    For the rest of the developers that don't use SqlDataSource the provided provider approach handles all possible binding scenarios.

    To answer you first question - unfortunately at this time there is no easier way to do that. Ideally we may provide events in the future so that one can subscribe to them and do whatever they want prior the underlying operation completes.

    Regards,
    Genady Sergeev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017