This is a migrated thread and some comments may be shown as answers.

Get ID of newly inserted appointment _AppointmentInsert Event

6 Answers 49 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Karl
Top achievements
Rank 1
Karl asked on 02 Oct 2013, 02:54 PM
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

6 Answers, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 03 Oct 2013, 05:09 PM
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.
0
Karl
Top achievements
Rank 1
answered on 04 Oct 2013, 06:39 AM
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?
0
Genady Sergeev
Telerik team
answered on 08 Oct 2013, 04:44 PM
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.
0
Fadil
Top achievements
Rank 1
answered on 09 Apr 2014, 10:08 AM
Has this been made simpler perhaps in the later versions?
the solution seems to be very convoluted for something that should be simple.
0
Fadil
Top achievements
Rank 1
answered on 09 Apr 2014, 10:23 AM
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

0
Genady Sergeev
Telerik team
answered on 10 Apr 2014, 07:37 AM
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.

 
Tags
Scheduler
Asked by
Karl
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Karl
Top achievements
Rank 1
Fadil
Top achievements
Rank 1
Share this question
or