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

#1048305 Wenn keine Konfiguration angegeben ist, wird auch nicht versucht zu prüfen

parent ff9f4acd
No related branches found
No related tags found
No related merge requests found
......@@ -10,48 +10,53 @@ let targetEntity = "Organisation_entity";
let valuesToCheck = {};
var entityFieldsToLoad = DuplicateScannerUtils.GetEntityFieldsFromConfig(scannerName, targetEntity);
//Read the values of all available entity fields and write the fieldname7value combination
//as key/value pairs into an object. This is used to trigger the scan for duplicates
vars.get("$field.STANDARD_CITY");
vars.get("$field.STANDARD_ZIP");
vars.get("$field.STANDARD_ADDRESS");
let field = '';
let fieldValue = '';
for (fieldname in entityFieldsToLoad)
{
field = entityFieldsToLoad[fieldname];
fieldValue = vars.get("$field." + field);
if(fieldValue != null && fieldValue != "")
{
valuesToCheck[field] = fieldValue;
}
}
let scanResults = DuplicateScannerUtils.ScanForDuplicates(scannerName, targetEntity,
valuesToCheck, null);
let duplicateIds = [];
if(scanResults != undefined && scanResults != null)
{
//Run thru every duplicate result and read out the id.
//Do it now to have a simple array on all usages lateron.
for (let i = 0; i < scanResults.length; i++)
{
let duplicateContactId = scanResults[i][indexsearch.FIELD_ID];
duplicateIds.push(duplicateContactId);
}
}
/*
* To achieve that if there are no duplicates, no contacts should be shown and therefore returned by the
* recordcontainer, an invalid id gets returned. It then is used in the conditionProcess to load the duplicates.
* Because of its invalidity, no records are shown.
*/
if(duplicateIds.length == 0)
if(entityFieldsToLoad == null || entityFieldsToLoad.length == 0)
result.string(JSON.stringify(["nodata"]));
else
result.string(JSON.stringify(duplicateIds));
\ No newline at end of file
{
//Read the values of all available entity fields and write the fieldname7value combination
//as key/value pairs into an object. This is used to trigger the scan for duplicates
vars.get("$field.STANDARD_CITY");
vars.get("$field.STANDARD_ZIP");
vars.get("$field.STANDARD_ADDRESS");
let field = '';
let fieldValue = '';
for (fieldname in entityFieldsToLoad)
{
field = entityFieldsToLoad[fieldname];
fieldValue = vars.get("$field." + field);
if(fieldValue != null && fieldValue != "")
{
valuesToCheck[field] = fieldValue;
}
}
let scanResults = DuplicateScannerUtils.ScanForDuplicates(scannerName, targetEntity,
valuesToCheck, null);
let duplicateIds = [];
if(scanResults != undefined && scanResults != null)
{
//Run thru every duplicate result and read out the id.
//Do it now to have a simple array on all usages lateron.
for (let i = 0; i < scanResults.length; i++)
{
let duplicateContactId = scanResults[i][indexsearch.FIELD_ID];
duplicateIds.push(duplicateContactId);
}
}
/*
* To achieve that if there are no duplicates, no contacts should be shown and therefore returned by the
* recordcontainer, an invalid id gets returned. It then is used in the conditionProcess to load the duplicates.
* Because of its invalidity, no records are shown.
*/
if(duplicateIds.length == 0)
result.string(JSON.stringify(["nodata"]));
else
result.string(JSON.stringify(duplicateIds));
}
\ No newline at end of file
......@@ -10,51 +10,57 @@ let targetEntity = "Person_entity";
let valuesToCheck = {};
var entityFieldsToLoad = DuplicateScannerUtils.GetEntityFieldsFromConfig(scannerName, targetEntity);
//Read the values of all available entity fields and write the fieldname7value combination
//as key/value pairs into an object. This is used to trigger the scan for duplicates
vars.get("$field.STANDARD_CITY");
vars.get("$field.STANDARD_ZIP");
vars.get("$field.STANDARD_ADDRESS");
vars.get("$field.FIRSTNAME");
vars.get("$field.LASTNAME");
let field = '';
let fieldValue = '';
for (fieldname in entityFieldsToLoad)
{
field = entityFieldsToLoad[fieldname];
fieldValue = vars.get("$field." + field);
if(fieldValue != null && fieldValue != "")
{
valuesToCheck[field] = fieldValue;
}
}
if(entityFieldsToLoad == null || entityFieldsToLoad.length == 0)
result.string(JSON.stringify(["nodata"]));
else
{
//Read the values of all available entity fields and write the fieldname7value combination
//as key/value pairs into an object. This is used to trigger the scan for duplicates
let scanResults = DuplicateScannerUtils.ScanForDuplicates(scannerName, targetEntity,
valuesToCheck, null);
vars.get("$field.STANDARD_CITY");
vars.get("$field.STANDARD_ZIP");
vars.get("$field.STANDARD_ADDRESS");
vars.get("$field.FIRSTNAME");
vars.get("$field.LASTNAME");
let duplicateIds = [];
if(scanResults != undefined && scanResults != null)
{
//Run thru every duplicate result and read out the id.
//Do it now to have a simple array on all usages lateron.
for (let i = 0; i < scanResults.length; i++)
{
let duplicateContactId = scanResults[i][indexsearch.FIELD_ID];
duplicateIds.push(duplicateContactId);
}
let field = '';
let fieldValue = '';
for (fieldname in entityFieldsToLoad)
{
field = entityFieldsToLoad[fieldname];
fieldValue = vars.get("$field." + field);
if(fieldValue != null && fieldValue != "")
{
valuesToCheck[field] = fieldValue;
}
}
let scanResults = DuplicateScannerUtils.ScanForDuplicates(scannerName, targetEntity,
valuesToCheck, null);
let duplicateIds = [];
if(scanResults != undefined && scanResults != null)
{
//Run thru every duplicate result and read out the id.
//Do it now to have a simple array on all usages lateron.
for (let i = 0; i < scanResults.length; i++)
{
let duplicateContactId = scanResults[i][indexsearch.FIELD_ID];
duplicateIds.push(duplicateContactId);
}
}
/*
* To achieve that if there are no duplicates, no contacts should be shown and therefore returned by the
* recordcontainer, an invalid id gets returned. It then is used in the conditionProcess to load the duplicates.
* Because of its invalidity, no records are shown.
*/
if(duplicateIds.length == 0)
result.string(JSON.stringify(["nodata"]));
else
result.string(JSON.stringify(duplicateIds));
}
/*
* To achieve that if there are no duplicates, no contacts should be shown and therefore returned by the
* recordcontainer, an invalid id gets returned. It then is used in the conditionProcess to load the duplicates.
* Because of its invalidity, no records are shown.
*/
if(duplicateIds.length == 0)
result.string(JSON.stringify(["nodata"]));
else
result.string(JSON.stringify(duplicateIds));
\ No newline at end of file
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