JayData 및 SQL Lite Provider (전화 간격)를 사용하여 데이터를 추가하거나 저장할 때. 다음과 같은 오류가 발생합니다.DEFAULT ERROR JayData에서 전화 받기
DefaultError : DEFAULT ERROR CALLBACK!
예외 데이터 : 인수 [1] 0 :있는 SQLError 코드 : 0 메시지 : "문 콜백 예외 또는 문 오류 콜백 false를 반환하지 않았습니다 제기" 프로토 :있는 SQLError .... .. 길이 : 1 프로토 : 개체 스택 : function() {[native code]} 메시지 : "DEFAULT ERROR CALLBACK!" 이름 "DefaultError" 설정 스택 : 함수() {[네이티브 코드]} 프로토 : 개체 jaydata.min.js 53 Guard.raise의 jaydata.min.js 53 catch되지 DefaultError : DEFAULT ERROR 콜백!
그러나 레코드가 추가/업데이트되었습니다. 그 문제가 ... 어떤 생각인지 몰라요?
코드는 다음과 같습니다
//Entities:
var Task = $data.Entity.extend("$org.types.Task", {
Id: { type: "int", key: true },
TaskType: { type: String, required: false },
StatusId: { type: "int", required: false },
DateScheduled: { type: Date, required: false },
TimeSlot: { type: String, required: false },
LastUpdated: { type: Date,required: false },
TaskName: { type: String, required: false },
SpecialInstructions: { type: String},
PropertyAddress: { type: String, required: false },
PropertyPostCode: { type: String, required: false },
PropertyType: { type: String, required: false },
NumberOfBedrooms: { type: "int", required: false },
HasGarage: { type: Boolean, required: false },
HasOutHouse: { type: Boolean, required: false },
IsReadyForReportGeneration: {type: Boolean},
TaskStatus: {type: String},
DateOfTaskDisplayName: {type: String}
});
//inside a look etc:
taskToUpdate.TaskType = task.TaskType;
taskToUpdate.StatusId = task.TaskStatusId;
taskToUpdate.TaskStatus = task.TaskStatus;
taskToUpdate.DateScheduled = task.Date;
taskToUpdate.TimeSlot = task.Time;
taskToUpdate.LastUpdated = new Date();
taskToUpdate.TaskName = "Job " + task.TaskId + " " + task.TaskType + " @" + task.AddressOfTask + ", " + task.PropertyPostCode;
taskToUpdate.SpecialInstructions = specialInstructions;
taskToUpdate.PropertyAddress = task.AddressOfTask;
taskToUpdate.PropertyPostCode = task.PropertyPostCode;
taskToUpdate.PropertyType = task.PropertyType;
taskToUpdate.NumberOfBedrooms = task.NumberOfBedrooms;
taskToUpdate.HasGarage = task.HasGarage;
taskToUpdate.HasOutHouse = task.HasOutHouse;
taskToUpdate.DateOfTaskDisplayName = task.DateOfTaskDisplayName,
taskToUpdate.IsReadyForReportGeneration = task.ReportReady;
if (result.length == 0) {
$org.context.Task.add(taskToUpdate);
}
rowsProcessed++;
if (rowsProcessed == rowsToProcess) {
$org.context.saveChanges({
success: function(db) {
viewModel.messages.push({message:"Tasks saved to local device."});
showNotificationInfo("Tasks saved to local device.");
hideLoader();
}, error: function(err) {
console.log(err);
viewModel.messages.push({message:"Errors saving tasks: " + err});
showNotificationError("Errors saving tasks: " + err);
hideLoader();
}
});
}
가 어떻게 taskToUpdate를 인스턴스화 할을 확인했다어요? –
attachOrGet ... 재미있는 점은 일부 테이블 정의를 변경하기 전까지는 잘 작동하는 것입니다. dropAllTables 옵션을 사용하여 모델 변경시 문제가 있는지 확인해 보았습니다. –
계산 추가 = ID는 고유 한 값을 갖는 데 도움이됩니다. 이것이 행동을 바꾸나요? – Robesz