2 Комити 5a11e8cbe9 ... e0823d0c6d

Аутор SHA1 Порука Датум
  klanecek e0823d0c6d Merge to head пре 4 месеци
  klanecek 7ec9113d6d Minor updates to crfVisit.js пре 4 месеци
1 измењених фајлова са 13 додато и 1 уклоњено
  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);
 	}