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

#1063252-Eigenschaften_leer

parent 17f5d509
No related branches found
No related tags found
No related merge requests found
......@@ -381,8 +381,14 @@ LeadImportUtils.insertAttr = function(pDataFields, pDataTypes, pFieldDef, pLeadV
if (pFieldDef[i][1].substr(0, 9) == "ATTRIBUTE" && pFieldDef[i][2] != undefined)//if Attribute
{
var attrdata = pFieldDef[i][2];
let countAttributes = newSelect("count(*)")
.from("AB_ATTRIBUTERELATION")
.where("AB_ATTRIBUTERELATION.OBJECT_ROWID", pContactId)
.and("AB_ATTRIBUTERELATION.AB_ATTRIBUTE_ID", attrdata[1][0])
.cell();
if (attrdata[2][pObjectID] != undefined)//e. g. if attrdata[2]["Organisation"] != undefined
if (attrdata[2][pObjectID] != undefined && countAttributes == 0)//e. g. if attrdata[2]["Organisation"] != undefined
{
var DataValues = new Object();
var value = pLeadValues[pFieldDef[i][1]];
......@@ -694,7 +700,15 @@ LeadImportUtils.sqlInsertAttr = function(pAttrObject, pAttrValues, pUser, pDate)
pAttrValues[9] = pUser;
pAttrValues[10] = pDate;
db.insertData("AB_ATTRIBUTERELATION", pAttrObject["Fields"] , pAttrObject["Types"], pAttrValues);
let countAttributes = newSelect("count(*)")
.from("AB_ATTRIBUTERELATION")
.where("AB_ATTRIBUTERELATION.OBJECT_ROWID", AttrValues[7])
.and("AB_ATTRIBUTERELATION.AB_ATTRIBUTE_ID", attrdata[1][0])
.cell();
if (countAttributes == 0) {
db.insertData("AB_ATTRIBUTERELATION", pAttrObject["Fields"] , pAttrObject["Types"], pAttrValues);
}
}
/**
......
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