Problem wiht drag and drop to create a new event

Hi guys, I have problems to create a new event.
I use these methods to controle the drag and drop. Whats the matter??

[code]scheduler.attachEvent(“onBeforeDrag”, function (event_id, mode, native_event_object){
ev = scheduler.getEvent(event_id);
idev = event_id;
prevfechaInicio = ev.start_date;
prevFechaFin = ev.end_date;

   		return true;
	scheduler.attachEvent("onBeforeEventChanged", function (event_object, native_event, is_new, unmodified_event){
   		//any custom logic here
   		fechaActual = new Date();
		if (prevfechaInicio<fechaActual && !is_new) {
			 scheduler.startLightbox(, html("my_form_obs"));
   		return true;

your onBeforeDrag handler throws js error when user creates new event with drag-and-drop:scheduler.attachEvent("onBeforeDrag", function (event_id, mode, native_event_object){ ev = scheduler.getEvent(event_id);please check the related article: … beforedrag
For “create” mode, id value is not provided ( new event is not created yet )

I dont think that is the problem. The problem is in the onBeforeEventChanged method. I was doing tests and in this part has the problem

[code]if (prevfechaInicio<fechaActual && !is_new) {
scheduler.startLightbox(, html(“my_form_obs”));


When the event is new.

Can you clarify the problem, what exactly goes wrong?

As for onBeforeDrag handler, you can use .getActionData method to retrieve drag position so it won’t throw error(and will save correct date value to the variable) when user creates new eventscheduler.attachEvent("onBeforeDrag", function (event_id, mode, native_event_object){ prevfechaInicio = scheduler.getActionData(native_event_object).date; return true; });

thanks Aliaksandr I solved it.

only I used a flag to compare if the event is new.