We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Recurrence Appointment Re-editing creating new appointment instead of updating

Thread ID:

Created:

Updated:

Platform:

Replies:

131853 Jul 31,2017 12:18 PM UTC Aug 2,2017 06:57 AM UTC ASP.NET MVC 10
loading
Tags: Schedule
Charles
Asked On July 31, 2017 12:18 PM UTC

Good morning,
I am using Schedule Control with MVC control databinding.
When I create Appointment with recurrence, it works fine and when I edit the whole series of Appointment, everything works fine also.
When I edit a single appointed within the series, It works fine too but when I now re-edit the previously edited single appointment. It creates another recuredit appointment
instead of editing the appointment, thus having two appointments. I believe the error is from the posted information from the schedule control to my controller. Find below the pictorial representation and the fiddler information of the data sent to the server from the control.

This is the JSON data sent to the Server when I was editing the First single Appointment
{
"changed": [{
"Subject": "12:45 PM",
"Description": null,
"StartTime": "2017-08-01T11:00:00.000Z",
"EndTime": "2017-08-01T11:45:00.000Z",
"StartTimeZone": "UTC +01:00",
"EndTimeZone": "UTC +01:00",
"Categorize": null,
"AllDay": false,
"Recurrence": true,
"RecurrenceRule": "FREQ=DAILY;INTERVAL=1;COUNT=8;EXDATE=8/3/2017",
"RecurrenceExDate": "8/3/2017",
"Territory": "EDO",
"RouteId": 31,
"CompanyId": 1,
"Id": 1,
"TerritoryId": 2,
"TerritoryRoutes": "EDO-BENIN(UGBOWO) -> LAGOS-Lagos(Yaba)",
"CompanyName": "EDEGBE MOTORS NIGERIA",
"RoomId": 2,
"OwnerId": 31,
"AppTaskId": 1,
"RecurrenceId": 1,
"ParentId": 1
}],
"added": [{
"Id": 19,
"Subject": "1:45 PM",
"StartTime": "2017-08-03T12:00:00.000Z",
"enableStartTime": false,
"EndTime": "2017-08-03T12:45:00.000Z",
"Recurrence": 1,
"Recurrence_hidden": "False",
"TerritoryId": 2,
"Territory": "EDO",
"RouteId": 31,
"TerritoryRoutes": "EDO-BENIN(UGBOWO) -> LAGOS-Lagos(Yaba)",
"Description": "",
"RecurrenceRule": "FREQ=DAILY;INTERVAL=1;COUNT=8;EXDATE=8/3/2017;RECUREDITID=1",
"CompanyId": "1",
"StartTimeZone": "UTC +01:00",
"EndTimeZone": "UTC +01:00",
"Guid": "ceaabd37-ae97-7b72-7568-0ec71555041f",
"AppTaskId": 19,
"RecurrenceId": 1,
"ParentId": 1
}],
"deleted": [],
"action": "batch",
"key": "Id"
}
When I was now re-editing the Appointment again, this was sent to the server
{
"changed": [{
"Subject": "12:45 PM",
"Description": null,
"StartTime": "2017-08-01T11:00:00.000Z",
"EndTime": "2017-08-01T11:45:00.000Z",
"StartTimeZone": "UTC +01:00",
"EndTimeZone": "UTC +01:00",
"Categorize": null,
"AllDay": false,
"Recurrence": true,
"RecurrenceRule": "FREQ=DAILY;INTERVAL=1;COUNT=8;EXDATE=8/3/2017,8/3/2017",
"RecurrenceExDate": "8/3/2017",
"Territory": "EDO",
"RouteId": 31,
"CompanyId": 1,
"Id": 1,
"TerritoryId": 2,
"TerritoryRoutes": "EDO-BENIN(UGBOWO) -> LAGOS-Lagos(Yaba)",
"CompanyName": "EDEGBE MOTORS NIGERIA",
"RoomId": 2,
"OwnerId": 31,
"AppTaskId": 1,
"RecurrenceId": 1,
"ParentId": 1
}],
"added": [{
"Id": 20,
"Subject": "2:45 PM",
"StartTime": "2017-08-03T13:00:00.000Z",
"enableStartTime": false,
"EndTime": "2017-08-03T13:45:00.000Z",
"Recurrence": 1,
"Recurrence_hidden": "False",
"TerritoryId": 2,
"Territory": "EDO",
"RouteId": 31,
"TerritoryRoutes": "EDO-BENIN(UGBOWO) -> LAGOS-Lagos(Yaba)",
"Description": "",
"RecurrenceRule": "FREQ=DAILY;INTERVAL=1;COUNT=8;EXDATE=8/3/2017,8/3/2017;RECUREDITID=1",
"CompanyId": "1",
"StartTimeZone": "UTC +01:00",
"EndTimeZone": "UTC +01:00",
"Guid": "f95393dc-9c86-3cc4-ec6c-c5067f8e17ed",
"AppTaskId": 20,
"RecurrenceId": 1,
"ParentId": 1
}],
"deleted": [],
"action": "batch",
"key": "Id"
}
I noticed that it sent changed param information for the Original Appointment Series (12:45 PM) instead of the Edited one of (1:45 PM). and its sending batch information parameters of added and change instead of maybe change only or update only.
Find below the Json values from DB for the Appointments.
[{
"Subject": "12:45 PM",
"Description": null,
"StartTime": "2017-08-01T12:00:00+01:00",
"EndTime": "2017-08-01T12:45:00+01:00",
"StartTimeZone": "UTC +01:00",
"EndTimeZone": "UTC +01:00",
"Categorize": null,
"AllDay": false,
"Recurrence": true,
"RecurrenceRule": "FREQ=DAILY;INTERVAL=1;COUNT=8;EXDATE=8/3/2017,8/3/2017",
"RecurrenceExDate": null,
"Territory": "EDO",
"RouteId": 31,
"CompanyId": 1,
"Id": 1,
"TerritoryId": 2,
"TerritoryRoutes": "EDO-BENIN(UGBOWO) -> LAGOS-Lagos(Yaba)",
"CompanyName": "EDEGBE MOTORS NIGERIA",
"RoomId": 2,
"OwnerId": 31
},
{
"Subject": "1:45 PM",
"Description": null,
"StartTime": "2017-08-03T13:00:00",
"EndTime": "2017-08-03T13:45:00",
"StartTimeZone": "UTC +01:00",
"EndTimeZone": "UTC +01:00",
"Categorize": null,
"AllDay": false,
"Recurrence": true,
"RecurrenceRule": "FREQ=DAILY;INTERVAL=1;COUNT=8;EXDATE=8/3/2017;RECUREDITID=1",
"RecurrenceExDate": null,
"Territory": "EDO",
"RouteId": 31,
"CompanyId": 1,
"Id": 6,
"TerritoryId": 2,
"TerritoryRoutes": "EDO-BENIN(UGBOWO) -> LAGOS-Lagos(Yaba)",
"CompanyName": "EDEGBE MOTORS NIGERIA",
"RoomId": 2,
"OwnerId": 31
},
{
"Subject": "2:45 PM",
"Description": null,
"StartTime": "2017-08-03T14:00:00+01:00",
"EndTime": "2017-08-03T14:45:00+01:00",
"StartTimeZone": "UTC +01:00",
"EndTimeZone": "UTC +01:00",
"Categorize": null,
"AllDay": false,
"Recurrence": true,
"RecurrenceRule": "FREQ=DAILY;INTERVAL=1;COUNT=8;EXDATE=8/3/2017,8/3/2017;RECUREDITID=1",
"RecurrenceExDate": null,
"Territory": "EDO",
"RouteId": 31,
"CompanyId": 1,
"Id": 7,
"TerritoryId": 2,
"TerritoryRoutes": "EDO-BENIN(UGBOWO) -> LAGOS-Lagos(Yaba)",
"CompanyName": "EDEGBE MOTORS NIGERIA",
"RoomId": 2,
"OwnerId": 31
}]
Thanks, I don't know where the issue is, though from what I just displayed now, am suspecting the RecurrenceExDate value that is null. I will try and be working it out but will be grateful if you can look into it.
Regards


Charles
Replied On July 31, 2017 03:13 PM UTC

Goodday, I just made sure that RecurrenceId and RecurrenceExDate are saved into the Db but still not working. Find below my controller function for Add, remove and Crud.

Add

public JsonResult AddScheduledRoutes(int companyid, ScheduleDataDto value)

        {

            var route = _routeService.GetRoute(value.RouteId);

            var company = _companyService.Get(companyid);

            var sched = value.ToScheduleData();

            sched.Route = route;

            sched.Company = company;

            sched.RouteName = route.Name;

            sched.CompanyName = company.Name;

            var resultsched =_routeService.AddScheduledRoute(sched);

            var finalresult = resultsched.ToDto();

            if (!resultsched.Recurrence)

            {

                _routeService.AddScheduleRouteDetails(resultsched);

            }

            if (resultsched.Recurrence && RecurrenceHelper.IsRecurEdit(resultsched.RecurrenceRule))

            {

                _routeService.AddScheduleRouteDetails(resultsched, true);

            }


            if (resultsched.Recurrence && !RecurrenceHelper.IsRecurEdit(resultsched.RecurrenceRule))

            {

                List<DateTime> dates = new List<DateTime>();

                var startdate = new DateTime(resultsched.EndTime.Year, resultsched.EndTime.Month, resultsched.EndTime.Day);

                dates = RecurrenceHelper.GetRecurrenceDateTimeCollection(resultsched.RecurrenceRule, startdate).ToList();

                _routeService.AddScheduleRouteDetails(resultsched, dates);

            }

            return GetCompanyScheduledRoutes(companyid, sched.Route.Id);

        }

Update

 public JsonResult UpdateCompanyScheduledRoutes(int companyid, ScheduleDataDto value)

        {

            var oldsched = _routeService.GetScheduledRoute(Convert.ToInt32(value.Id));

            if (oldsched != null)

            {

                DateTime startTime = Convert.ToDateTime(value.StartTime);

                DateTime endTime = Convert.ToDateTime(value.EndTime);

                oldsched.StartTime = startTime;

                oldsched.EndTime = endTime;

                oldsched.Subject = value.Subject;

                oldsched.StartTimeZone = value.StartTimeZone;

                oldsched.EndTimeZone = value.EndTimeZone;

                oldsched.Description = value.Description;

                oldsched.Recurrence = Convert.ToBoolean(value.Recurrence);

                oldsched.AllDay = value.AllDay;

                oldsched.RecurrenceRule = value.RecurrenceRule;

                oldsched.RecurrenceExDate = value.RecurrenceExDate;

                

_routeService.UpdateSchedule(oldsched);

                _routeService.UpdateScheduleDetail(oldsched);

            }

            return GetCompanyScheduledRoutes(companyid, Convert.ToInt32(value.RouteId));

        }

CRUD

public JsonResult Crud(EditParams param)

        {

            var companyid = 0;

            if (param.action == "insert" || (param.action == "batch" && param.added != null))          // this block of code will execute while inserting the appointments

            {

                foreach (var apps in param.added)

                {

                    var value = param.action == "insert" ? param.value : apps;


                    var route = _routeService.GetRoute(value.RouteId);

                    var company = route.Company;

                    companyid = company.Id;

                    var sched = value.ToScheduleData();

                    sched.Route = route;

                    sched.Company = company;

                    sched.RouteName = route.Name;

                    sched.CompanyName = company.Name;

                    var resultsched =_routeService.AddScheduledRoute(sched);


                    if (resultsched.Recurrence && !RecurrenceHelper.IsRecurEdit(resultsched.RecurrenceRule))

                    {

                        List<DateTime> dates = new List<DateTime>();

                        var startdate = new DateTime(resultsched.EndTime.Year, resultsched.EndTime.Month, resultsched.EndTime.Day);

                        dates = RecurrenceHelper.GetRecurrenceDateTimeCollection(resultsched.RecurrenceRule, startdate).ToList();

                        _routeService.AddScheduleRouteDetails(resultsched, dates);

                    }

                    if (resultsched.Recurrence && RecurrenceHelper.IsRecurEdit(resultsched.RecurrenceRule))

                    {

                        

                        _routeService.AddScheduleRouteDetails(resultsched, true);

                        // _routeService.AddScheduleRouteDetails(resultsched);


                    }

                }


            }

            if ((param.action == "batch" && param.changed != null) || param.action == "update")   // this block of code will execute while updating the appointment

            {

                var value = param.action == "update" ? param.value : param.changed[0];

                var oldsched = _routeService.GetScheduledRoute(Convert.ToInt32(value.Id)) ;

                if (oldsched != null)

                {

                    DateTime startTime = Convert.ToDateTime(value.StartTime);

                    DateTime endTime = Convert.ToDateTime(value.EndTime);

                    oldsched.StartTime = startTime;

                    oldsched.EndTime = endTime;

                    oldsched.Subject = value.Subject;

                    oldsched.StartTimeZone = value.StartTimeZone;

                    oldsched.EndTimeZone = value.EndTimeZone;

                    oldsched.Description = value.Description;

                    oldsched.Recurrence = Convert.ToBoolean(value.Recurrence);

                    oldsched.AllDay = value.AllDay;

                    oldsched.RecurrenceRule = value.RecurrenceRule;

                    oldsched.RecurrenceExDate = value.RecurrenceExDate;

                }

               

                _routeService.UpdateSchedule(oldsched);

                _routeService.UpdateScheduleDetail(oldsched, true);

            }


            ScheduleDataSearchQuery search = new ScheduleDataSearchQuery { CompanyId = companyid };

            var result = _routeService.GetAllScheduledRoutes(search).Entity;

            return Json(result.ToDtoWithoutList(), JsonRequestBehavior.AllowGet);

        }

Have not added the remove block for the Crud Function. Want to sort this out first.





Charles
Replied On July 31, 2017 05:07 PM UTC

I decided to Check the clear my db and recreate from scratch and use chrome inspector to check the schedule values. They are the same with what is in my Db, don't understand why whenever I want to edit a detached recurrence appointment, it sends added params and not update params. Find below another Json object from my Db and also the image of google inspector. I check the _currentAppointmentData property on the Schedule control and the contents are the same with what is in my Db.

My Db Data

[{

"Subject": "5:00 PM",

"Description": null,

"StartTime": "2017-07-31T16:15:00",

"EndTime": "2017-07-31T17:00:00",

"StartTimeZone": "UTC +01:00",

"EndTimeZone": "UTC +01:00",

"Categorize": null,

"AllDay": false,

"Recurrence": false,

"RecurrenceRule": null,

"RecurrenceExDate": null,

"Territory": "EDO",

"RouteId": 31,

"CompanyId": 1,

"Id": 1,

"TerritoryId": 2,

"TerritoryRoutes": "EDO-BENIN(UGBOWO) -> LAGOS-Lagos(Yaba)",

"CompanyName": "EDEGBE MOTORS NIGERIA",

"RoomId": 2,

"OwnerId": 31,

"RecurrenceList": null,

"FullRecurrenceList": null,

"RecurrenceId": 0

}, {

"Subject": "11:00 AM",

"Description": null,

"StartTime": "2017-08-02T10:15:00",

"EndTime": "2017-08-02T11:00:00",

"StartTimeZone": "UTC +01:00",

"EndTimeZone": "UTC +01:00",

"Categorize": null,

"AllDay": false,

"Recurrence": true,

"RecurrenceRule": "FREQ=DAILY;INTERVAL=1;COUNT=8;EXDATE=8/3/2017,8/3/2017",

"RecurrenceExDate": "8/3/2017",

"Territory": "EDO",

"RouteId": 31,

"CompanyId": 1,

"Id": 2,

"TerritoryId": 2,

"TerritoryRoutes": "EDO-BENIN(UGBOWO) -> LAGOS-Lagos(Yaba)",

"CompanyName": "EDEGBE MOTORS NIGERIA",

"RoomId": 2,

"OwnerId": 31,

"RecurrenceList": null,

"FullRecurrenceList": null,

"RecurrenceId": 2

}, {

"Subject": "10:30 AM",

"Description": null,

"StartTime": "2017-08-03T09:45:00",

"EndTime": "2017-08-03T10:30:00",

"StartTimeZone": "UTC +01:00",

"EndTimeZone": "UTC +01:00",

"Categorize": null,

"AllDay": false,

"Recurrence": true,

"RecurrenceRule": "FREQ=DAILY;INTERVAL=1;COUNT=8;EXDATE=8/3/2017;RECUREDITID=2",

"RecurrenceExDate": null,

"Territory": "EDO",

"RouteId": 31,

"CompanyId": 1,

"Id": 3,

"TerritoryId": 2,

"TerritoryRoutes": "EDO-BENIN(UGBOWO) -> LAGOS-Lagos(Yaba)",

"CompanyName": "EDEGBE MOTORS NIGERIA",

"RoomId": 2,

"OwnerId": 31,

"RecurrenceList": null,

"FullRecurrenceList": null,

"RecurrenceId": 2

}

]

The Initial Recurrent Appointed.


The Detached and Edited Appointment. Anytime I edit this to another date, it sends added and change param to my MVC instead of update and change. The properties of this appointment are not even included in the data posted to the server.







Karthigeyan Krishnamurthi [Syncfusion]
Replied On August 1, 2017 05:09 AM UTC

Hi Charles,  
 
Thank you for contacting Syncfusion support. 
 
We have checked the scenario in latest source and unable to reproduce the reported issue at our end. We have prepared the sample for the same for your reference which can be download from the below location. 
 
Kindly try the sample and if the issue persists, try to reproduce the error in a sample and revert it back to us. Or else you can share your runnable sample (if possible) to proceed further.   
 
Regards, 
Karthigeyan 



Charles
Replied On August 1, 2017 07:10 AM UTC

Good morning,

I am using a Custom appointment window open, I notice that if I disable that and use the default appointment window open, everything works fine but when I use my custom window open, it doesn't work. Find below my codes.

I couldn't paste my codes, seems they are more than required word limit.

Find attached is a zipped file that contains 2 files Appointment and Save.js (a js file that I just pasted my onAppointmentWindowOpen and Save functions) and Schedule.js that has my full js functions. I believe the error should be in my onAppointmentWindowOpen or Save Function.


Attachment: Appointmentopen_and_Save_e9409105.zip

Charles
Replied On August 1, 2017 09:11 AM UTC

@(Html.EJ().Schedule("routeSchedule")

                      .Width("100%")

                      .Height("725px")

                      .CurrentDate(schedulableDay)

                      .HighlightBusinessHours(true)

                      .ShowNextPrevMonth(true)

                      .WorkHours(x => x.Highlight(true).Start(Model.Setting.BusinessStartHour).End(Model.Setting.BusinessEndHour))

                      .StartHour(Model.Setting.ScheduleStartHour)

                      .EndHour(Model.Setting.ScheduleEndHour)

                      .AgendaViewSettings(i => i.DaysInAgenda(14))

                      .TimeMode(timemode)

                      .Resources(res =>

                      {  res.Field("TerritoryId").Title("Territory").Name("Territories").AllowMultiple(true).ResourceSettings(fld => fld.Datasource(initialTerrittory)

                              .Text("Text").Id("Id")).Add();

                          res.Field("RouteId").Title("Route").Name("Routes").AllowMultiple(true).ResourceSettings(flds => flds.Datasource(initialTerritoryRoutes)

                              .Text("Text").Id("Id").GroupId("GroupId").Color("Color")).Add();

                      })

                      .Group(gr => gr.Resources(Group))

                      .ShowLocationField(true)

                      .CategorizeSettings(cat => cat.Enable(true))

                      .ShowAllDayRow(false)

                      .ShowCurrentTimeIndicator(true)

                      .Views(view)

                      .CurrentView(CurrentView.Month)

                      .WorkWeek(workWeek)

                      .AppointmentSettings(fields => fields.Datasource(ds => ds.URL(@Url.Action("GetCompanyScheduledRoutes", "Route", new { companyid = Model.Id, routeid = firstroute, territoryid = firstterritory })).InsertURL(Url.Action("AddScheduledRoutes", "Route", new { companyid = Model.Id }))

                          .BatchURL(@Url.Action("Crud", "Route")).RemoveURL(@Url.Action("RemoveCompanyScheduledRoutes", "Route", new { companyid = Model.Id }))

                          .UpdateURL(@Url.Action("UpdateCompanyScheduledRoutes", "Route", new { companyid = Model.Id })).Adaptor(AdaptorType.UrlAdaptor))

                          .Id("Id")

                          .Subject("Subject")

                          .StartTime("StartTime")

                          .EndTime("EndTime")

                          .StartTimeZone("StartTimeZone")

                          .EndTimeZone("EndTimeZone")

                          .Description("Comments")

                          .AllDay("AllDay")

                          .Recurrence("Recurrence")

                          .RecurrenceRule("RecurrenceRule")

                          .RecurrenceId("RecurrenceId")

                          .RecurrenceExDate("RecurrenceExDate")

                          .Location("Location")

                          .ResourceFields("TerritoryId, RouteId"))

                      .ScheduleClientSideEvents(eve => eve.Navigation("OnNavigation").QueryCellInfo("OnQueryCellInfo").CellClick("OnCellClick").AppointmentWindowOpen("onAppointmentWindowOpen").Create("onCreate").ActionBegin("onBegin").DragStop("onAction").ResizeStop("onAction").ActionComplete("onComplete").CellHover("onCellHover").DragStart("onStart")

                      .ResizeStart("onStart").BeforeAppointmentCreate("OnBeforeAppointmentCreate").BeforeAppointmentChange("OnBeforeAppointmentChange")))



Charles
Replied On August 1, 2017 09:12 AM UTC

@Html.EJ().Dialog("customWindow").Width("600").Height("auto").ShowOnInit(false).EnableModal(true).Title("Create Route Schedule").EnableResize(false).AllowKeyboardNavigation(false).ClientSideEvents(eve => eve.Close("clearFields")).ContentTemplate(

    @<div>

        <div id="appWindow" class="e-windowmargin">

            <form id="custom">

                <div class="container-fluid">

                    <div class="row epadding" style="display: none;">

                        <div class="col-md-3">Id</div>

                        <div class="col-md-9">

                            <input id="customId" type="text" name="Id" />

                        </div>

                    </div>

                    <div class="row epadding">

                        <div class="col-md-3">Subject</div>

                        <div class="col-md-9">

                            <input id="subject" type="text" value="" name="Subject" onfocus="temp()" style="width: 100%" readonly="readonly" />

                        </div>

                    </div>

                    <div class="row epadding">

                        <div class="col-md-3">Passenger ETA</div>

                        <div class="col-md-4">

@Html.EJ().DateTimePicker("StartTime").Width("150px").MinDateTime(minDateTime).MaxDateTime(maxDateTime).Interval(Model.Setting.ScheduleTimeInterval).TimeDisplayFormat(timedisplayformat).Enabled(false)

                        </div>

                        <div class="col-md-5">

                            @Html.EJ().CheckBox("enableStartTime").ClientSideEvents(s => s.Change("changeState")).Text("Enable Passenger ETA")

                        </div>

                    </div>

                    <div class="row epadding">

                        <div class="col-md-3">Departure Time</div>

                        <div class="col-md-4">

                            @(Html.EJ().DateTimePicker("EndTime").Width("150px").MinDateTime(minDateTime).MaxDateTime(maxDateTime).Enabled(true)

                                  .Interval(Model.Setting.ScheduleTimeInterval)

                                  .ClientSideEvents(evt => evt.Change("changeDepartureTime"))

                                  .TimeDisplayFormat(timedisplayformat))

 

                        </div>

 

                        <div class="col-md-2">

                            @Html.EJ().CheckBox("recurrence").Name("Recurrence").Checked(false).Enabled(true).ClientSideEvents(eve => eve.Change("recurCheck")).Text("Repeat")

                        </div>

                        <div class="col-md-2 e-recuredit" id="editApp" style="display: block;"><a class="recuredit" rel='nofollow' href="#" style="float: left; padding-left: 10px;">Edit</a></div>

                    </div>

 

                    <div class="row epadding">

                        <div class="col-md-3">Territory</div>

                        <div class="col-md-9">

                            <input type="text" id="Territory" style="width: 100%" />

                        </div>

                    </div>

                    <div class="row epadding">

 

                        <div class="col-md-3 ">Route</div>

                        <div class="col-md-9">

                            <input type="text" id="TerritoryRoutes" style="width: 100%" />

                        </div>

                    </div>

 

                    <div class="row epadding">

                        <div class="col-md-3">Comments</div>

                        <div class="col-md-9">

                            <textarea id="customdescription" name="Description" rows="3" cols="50" style="width: 100%; resize: vertical"></textarea>

                        </div>

                    </div>

                </div>

            </form>

            <br />

            <div class="pull-right" style="margin-bottom: 20px; padding-right: 20px">

                <button type="submit" id="appsubmit">Submit</button>

                <button type="submit" id="appcancel">Cancel</button>

 

            </div>

        </div>

        <div id="recWindow" style="display: none">

            @Html.EJ().RecurrenceEditor("recurrenceEditor").SelectedRecurrenceType(0).RecurrenceEditorClientSideEvents(evt => evt.Change("onRecurChange")).Frequencies(new List<string> { "daily", "weekly", "monthly", "yearly", "everyweekday" })

            <br />

            <div>

                <button type="submit" id="reccancel">Cancel</button>

                <button type="submit" id="recsubmit">Submit</button>

            </div>

        </div>

    </div>)


Charles
Replied On August 1, 2017 02:11 PM UTC

On deeper investigation into the difference between the object sent to the Default Appointment window and that sent to the custom Appointment window. I noticed no difference in the object sent but where the difference was inside the Schedule saveAppointment method itself. I added some code to the actionComplete event 

function onComplete(args) {

    if (args.requestType === "dateNavigate" || args.requestType === "viewNavigate") {

        onCreate();

    }

    if (args.requestType === "appointmentEdit") {

        console.log(args.requestType);

        console.log(args);

    }

}

So I got out the object actually inside the saveAppointment() method of the Schedule Control and saw the differences as shown below.

1) Sample of Object passed with Id = 3 which is the Id of the Appointment. This is the Object created before saving and still remain the same after saving.


2) But the some properties of the Object changed while inside the Schedule Control saveAppointment() method. I noticed that the Id changed to 13 which is 

the AppTaskId. More so, the currentAction is shown as "editOccurence" while that of the default appointment window showed "edit" The recurrenceRule seems to repeat the date also, though I don't think that has anything to do with the issue.



3) The Default Window gave the correct properties and nothing changed from the intended object. The Id remains the same and the recurrence rule seems Ok.

What could have been making the properties to change in the custom appointment window as shown above.




Charles
Replied On August 1, 2017 05:58 PM UTC

After digging deeper, I noticed that the recurrence value is changing from true to integer value of 1 in the save function. when populating the object, the value is true but thereafter the value somehow changes to integer 1. I checked it out for new Creation of Appointment, it value of recurrence false, stays the same. It doesn't change to any integer value.For Creation of New Appointment, the recurrence remained false, didn't change to any integer value. So what could causing this.


For Creation of New Appointed, the value of false for recurrence property remains the same, it doesn't change to any integer value.


By commenting out the schObj.saveAppointment(obj) and trying to get the actual properties of the object passed into the saveAppointment function, I realized that it was the saveAppointment function that is changing the values of the object since it is a reference object, the changed value is passed back.




Charles
Replied On August 1, 2017 11:05 PM UTC

Good evening,

Here is a link to a running sample.

http://jsplayground.syncfusion.com/dvq303oh

The interesting thing is that it is running perfectly well in the playground, though am using local data in the sample and am using MVC controller on my system and my datamanager is like below on my system. 

var dataManager = ej.DataManager({

            url: "/Admin/Apps/SyncBus/Route/getCompanyscheduledroutes?companyid=" + companyid + "&routeid=" + currentRouteList[0].Id, //  This will trigger to bind the appointments data to schedule control

            batchUrl: "/Admin/Apps/SyncBus/Route/Crud", // This will trigger while saving the appointment through detail window

            insertUrl: "/Admin/Apps/SyncBus/Route/AddScheduledRoutes?companyid=" + companyid, // This will trigger while saving the appointment through quick window

            updateUrl: "/Admin/Apps/SyncBus/Route/UpdateCompanyScheduledRoutes?companyid=" + companyid, //This will trigger while saving the resize or drag and drop the appointment 

            removeUrl: "/Admin/Apps/SyncBus/Route/RemoveCompanyScheduledRoutes?companyid=" + companyid, // This will trigger to delete the single appointment

            adaptor: new ej.UrlAdaptor()

        });


I don't understand at all, the data posted to my server contains both add (new Id)  and change (Id = 2) parameters instead of just change parameter for (Id = 3)I still wonder why the recurrence changes to Integer whenever it is true, even in my sample on playground and also on my computer system, it always send the Id of the main appointment series which is 2 instead of the Id 3 of the intended appointment.



Karthigeyan Krishnamurthi [Syncfusion]
Replied On August 2, 2017 06:57 AM UTC

Hi Charles, 
 
Thanks for your update. 
 
We have created an incident for your query and we request you to have a follow up with the below incident link for further update. 
 
Regards, 
Karthigeyan 
 



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;