2 Achegas 5a11e8cbe9 ... e0823d0c6d

Autor SHA1 Mensaxe Data
  klanecek e0823d0c6d Merge to head hai 2 meses
  klanecek 7ec9113d6d Minor updates to crfVisit.js hai 2 meses
Modificáronse 1 ficheiros con 13 adicións e 1 borrados
  1. 13 1
      web/crf/crfVisit.js

+ 13 - 1
web/crf/crfVisit.js

@@ -48,6 +48,12 @@ function doNothing(){
 	print('doNothing called');
 }
 
+function doFailure(errorInfo){
+	print('Error '+errorInfo.exception);
+	print('Trace '+errorInfo.stackTrace);
+	alert('Failed with '+errorInfo.exception);
+}
+
 function generateDebugSection(){
 	//let debug=true;
 	//if (debug) print("generateDebugSection "+sectionName);
@@ -1812,7 +1818,12 @@ function afterStudyUpload(data){
 		if (listRows.length>1){
 			entry.SequenceNum+=i/100;
 		}
-		print( "Adding sequence number "+entry.SequenceNum);
+		delete entry.Key;
+		print( "Adding sequence number "+entry.SequenceNum + " key " + entry.Key);
+		for (q in entry){
+			print("\t["+q+"]: "+entry[q]);
+		}
+		//remove Key as it might interferre with preset values
 		rows.push(entry);
 	}
 	if (rows.length>0){
@@ -1822,6 +1833,7 @@ function afterStudyUpload(data){
 		qconfig.schemaName="study";
 		qconfig.containerPath=getContainer('data');
 		qconfig.success=afterListUpload;
+		qconfig.failure=doFailure;
 		qconfig.rows=rows;
 		LABKEY.Query.insertRows(qconfig);
 	}