From ac0f7602f66030ed5a1d9e8e4e0419fcce9ad59a Mon Sep 17 00:00:00 2001 From: Johannes Hoermann <j.hoermann@adito.de> Date: Tue, 19 Nov 2019 14:55:48 +0100 Subject: [PATCH] Bugfixes Leadimport --- process/Leadimport_lib/process.js | 4 ++-- process/importLead_serverProcess/process.js | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/process/Leadimport_lib/process.js b/process/Leadimport_lib/process.js index 3d89bd6727..f0ccc50866 100644 --- a/process/Leadimport_lib/process.js +++ b/process/Leadimport_lib/process.js @@ -214,7 +214,7 @@ function ImportData(pDataFields, pDataTypes, pFieldDef, pFieldValues, pImportDef var leadId = InsertTable(pDataFields, pDataTypes ,LeadValues, "LEAD", pUser, pDate);//inserts the LEAD dataset - InsertLeadAttr(pAttrObject, orgid, persid, LeadValues["DATE_NEW"], pUser, pDate, orgRet[3]); + InsertLeadAttr(pAttrObject, orgid, persid, LeadValues["DATE_NEW"], pUser, pDate, (orgRet && orgRet.length >= 4 && orgRet[3])); return [leadId, persForDubCheck, orgsForDubCheck]; } @@ -466,7 +466,7 @@ function InsertComm(pDataFields, pDataTypes, pLeadValues, contactId, pUser, pDat * @param {String} pUser req the importuser * @param {String} pDate req the importdate * -* @return {String []} ( organisationId, contactId, duplicateMapping, true/false) +* @return {String[]} ( organisationId, contactId, duplicateMapping, true/false) */ function InsertOrg(pDataFields, pDataTypes, pFieldDef, pFieldValues, pUser, pDate) { diff --git a/process/importLead_serverProcess/process.js b/process/importLead_serverProcess/process.js index 1b93ce3fd3..a1e3c5104a 100644 --- a/process/importLead_serverProcess/process.js +++ b/process/importLead_serverProcess/process.js @@ -129,12 +129,14 @@ try { var dupCheck = ImportData(DataFields, DataTypes, FieldDef, impvalues, importdefid, AttrObject, source, user, currDate); - allContactData[dubCheck[0]] = [dupCheck[1], dupCheck[2]]; //persObj, orgObj + allContactData[dupCheck[0]] = [dupCheck[1], dupCheck[2]]; //persObj, orgObj } catch(ex)//if error increase the errorCount and write a rhinoException into the string for the error file { - exeptions = exeptions + "Zeile " + dsanz + ": " + logging.toLogString(ex.rhinoException != undefined ? ex.rhinoException : ex, true) + "\r\n"; + var exeption = "Zeile " + dsanz + ": " + logging.toLogString(ex.rhinoException != undefined ? ex.rhinoException : ex, true) + "\r\n"; + exeptions = exeptions + exeption; errorCount++; + logging.log(exeption); } } } @@ -171,6 +173,7 @@ if(exeptions != "")//insert error document if (userId)// if there is an user - show a notification to this user when the import is complete { var description = translate.withArguments("%0 leads imported, %1 errors", [rows, errorCount]); + logging.log(JSON.stringify([exeptions], null, "\t")) notification.addNotification(util.getNewUUID(), null, null, null, "LeadImport_Notification", notification.PRIO_NORMAL, 2, notification.STATE_UNSEEN, [userId], importName, description); } -- GitLab