Hi Claudio,
Thank you for contacting Syncfusion support.
We have prepared the sample to access the previous appointment field values while creating an appointment, which can be download from the below location.
In the sample when an appointment is saved, BeforeAppointmentCreate event will be raised where your requirement can be achieved. Kindly refer the below code example used in the sample.
<Code>
function onBeforeAppointmentCreate(args) {
var predicate = ej.Predicate(this._appointmentSettings["startTime"], ej.FilterOperators.lessThanOrEqual, new Date(args.appointment.StartTime));
var newAppList = new ej.DataManager(this._currentAppointmentData).executeLocal(new ej.Query().where(predicate)); // app collection before the new added app will be retrived
var proxy = this;
newAppList.sort(function (a, b) { // sorting the app collection based on start time
var d1 = a[proxy._appointmentSettings["startTime"]];
var d2 = b[proxy._appointmentSettings["startTime"]];
return d1.getTime() - d2.getTime();
});
if (newAppList.length>0)
args.appointment["Location"] = 4 + newAppList[newAppList.length - 1].Location; // last app in the collection value is accessed here.
}
</Code>
Regards,
Karthigeyan