Skip to content
Snippets Groups Projects
Commit a1cbadf9 authored by Sebastian Pongratz's avatar Sebastian Pongratz :ping_pong: Committed by Sebastian Listl
Browse files

#1069285 leadimport validierung

parent 37a959c0
No related branches found
No related tags found
No related merge requests found
......@@ -8,20 +8,20 @@ var attributeChanges = {
"NAME" : []
};
var attributeChangesKeys = Object.keys(attributeChanges);
var idMapping = {};
var consumerField = "ImportFieldID";
var changedRows = vars.get("$field." + consumerField + ".changedRows");
newSelect(["IMPORTFIELD.MAPPINGFIELD", "IMPORTFIELD.IMPORTFIELDID"])
var importdata = newSelect(["IMPORTFIELD.MAPPINGFIELD", "IMPORTFIELD.IMPORTFIELDID"])
.from("IMPORTFIELD")
.where("IMPORTFIELD.LEADIMPORT_ID", "9f77f90f-cc49-456f-8d20-2fa86bf6fdf4")
.and(
newWhere("IMPORTFIELD.MAPPINGFIELD", "LASTNAME")
.or("IMPORTFIELD.MAPPINGFIELD", "NAME"))
.table()
.forEach(function (row) {
_addNewID(row[0], row[1]);
});
.where("IMPORTFIELD.LEADIMPORT_ID", vars.get("$field.LEADIMPORTID"))
.and("IMPORTFIELD.MAPPINGFIELD", attributeChangesKeys, SqlBuilder.IN())
.table();
importdata.forEach(function (row) {
_addNewID(row[0], row[1]);
});
if (changedRows)
{
......@@ -44,7 +44,7 @@ if (changedRows)
});
}
if (!attributeChanges.NAME.length && !attributeChanges.LASTNAME.length)
if (!attributeChanges.NAME.length && !attributeChanges.LASTNAME.length && changedRows.length)
{
result.string(translate.text("The Import Fields \"Lastname\" or \"Organisation\" have to be mapped!"));
}
......
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