Skip to content
Snippets Groups Projects
Commit 5492fd23 authored by David Büchler's avatar David Büchler
Browse files

Es werden keine Kontakte mehr im Dublettenreiter angezeigt, wenn es keine Dubletten gibt.

parent 4c744160
No related branches found
No related tags found
No related merge requests found
......@@ -3,9 +3,19 @@ import("system.vars");
import("DuplicateScanner_lib");
import("system.result");
let contactIdToCheck = vars.get("$field.CONTACTID");
logging.log("im person consumer -> " + contactIdToCheck );
let test = JSON.stringify(DuplicateScannerUtils.GetCachedDuplicatesForContactId(contactIdToCheck))
logging.log("test -> " + test);
result.string(test);
\ No newline at end of file
let duplicateIds = DuplicateScannerUtils.GetCachedDuplicatesForContactId(contactIdToCheck);
/*
* To achieve that if there are no duplicates, no contacts should be shown and therefore returned by the
* recordcontainer, a "nonsense" id gets returned. It then is used in the conditionProcess.
* Because of its invalidity, no records are shown.
*/
logging.log("duplicateIds -> " + duplicateIds);
logging.log("duplicateIds -> " + duplicateIds.length);
if(duplicateIds.length == 0)
result.string(JSON.stringify(["nodata"]));
else
result.string(JSON.stringify(duplicateIds));
\ No newline at end of file
......@@ -12,9 +12,6 @@ var onlyShowContactIds = JSON.parse(vars.get("$param.OnlyShowContactIds_param"))
var additionalCondition = SqlCondition.begin();
let alternativeCondition = "1 = 1";
logging.log(" onlyShowContactIds-> " + onlyShowContactIds);
if (vars.exists("$param.ExcludedContactIds_param") && vars.get("$param.ExcludedContactIds_param"))
{
var excludedContacts = JSON.parse(vars.getString("$param.ExcludedContactIds_param"));
......@@ -27,11 +24,12 @@ if (vars.exists("$param.ExcludedContactIds_param") && vars.get("$param.ExcludedC
cond.andSqlCondition(additionalCondition, "1=1");
}
if(onlyShowContactIds != null || onlyShowContactIds.length != 0)
if(onlyShowContactIds != null && onlyShowContactIds.length > 0)
{
logging.log("hallo -> ");
onlyShowContactIds.forEach(function(pContactId)
{
logging.log("pContactId -> " + pContactId);
additionalCondition.orPrepare("CONTACT.CONTACTID", pContactId);
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment