From a3256c0a7f1dcfac39228cf5988055c997bb80f5 Mon Sep 17 00:00:00 2001 From: Juan Garcia Date: Tue, 25 Jan 2022 15:20:37 -0500 Subject: [PATCH] Fix findMatchingLookupRecordSourceKey returning undefined VlocityLookupRecordSourceKey --- lib/datapackserrorhandling.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/datapackserrorhandling.js b/lib/datapackserrorhandling.js index 8967e31c..5a849f4e 100644 --- a/lib/datapackserrorhandling.js +++ b/lib/datapackserrorhandling.js @@ -404,21 +404,21 @@ DataPacksErrorHandling.prototype.findMatchingLookupRecordSourceKey = function(da for (var i = 0; i < searchPathMap.searchPath.length; i++) { if (dataPack.hasOwnProperty(searchPathMap.searchPath[i])) { var nodeVal = dataPack[searchPathMap.searchPath[i]]; - if (searchPathMap.compareValues) { + var match = 0; for (var z = 0; z < searchPathMap.compareValues.length; z++) { - var allMatch = true; for (var key in searchPathMap.compareValues[z]) { if (nodeVal.hasOwnProperty(key)) { - if (nodeVal[key] !== searchPathMap.compareValues[z][key]) { - allMatch = false; + if (nodeVal[key] === searchPathMap.compareValues[z][key]) { + match++; //return nodeVal.VlocityLookupRecordSourceKey; } } } - if(allMatch){ - return nodeVal.VlocityLookupRecordSourceKey; - } + + } + if(match == searchPathMap.compareValues.length){ + return nodeVal.VlocityLookupRecordSourceKey; } }