浏览代码

Minor updates to crfVisit.js

klanecek 2 月之前
父节点
当前提交
7ec9113d6d
共有 1 个文件被更改,包括 14 次插入2 次删除
  1. 14 2
      web/crf/crfVisit.js

+ 14 - 2
web/crf/crfVisit.js

@@ -41,6 +41,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);
@@ -1614,7 +1620,12 @@ function afterStudyUpload(configUpload,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){
@@ -1625,6 +1636,7 @@ function afterStudyUpload(configUpload,data){
 		qconfig.containerPath=getContainer('data');
 		qconfig.success=function(data){
 			afterListUpload(configUpload,data)};
+		qconfig.failure=doFailure;
 		qconfig.rows=rows;
 		LABKEY.Query.insertRows(qconfig);
 	}
@@ -2372,7 +2384,7 @@ function setFormConfig(){
 	//add object to store form related data
 	config.formConfig=new Object();
 
-	config.formConfig.softwareVersion='0.12.6';
+	config.formConfig.softwareVersion='0.12.9';
 	let debug=true;
 
 	if (debug)