diff --git a/.liquibase/Data_alias/basic/2021.0.0/addDateNewToSalesproject.xml b/.liquibase/Data_alias/basic/2021.0.0/addDateNewToSalesproject.xml new file mode 100644 index 0000000000000000000000000000000000000000..93663b59e73ce1a792cc2adb213d0e3087105d58 --- /dev/null +++ b/.liquibase/Data_alias/basic/2021.0.0/addDateNewToSalesproject.xml @@ -0,0 +1,10 @@ +<?xml version="1.1" encoding="UTF-8" standalone="no"?> +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> + <changeSet author="s.pongratz" id="37812654-5f30-4256-9704-976567da1dd3"> + <addColumn tableName="SALESPROJECT"> + <column name="DATE_NEW" type="DATETIME" /> + </addColumn> + </changeSet> +</databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/basic/2021.0.0/changelog.xml b/.liquibase/Data_alias/basic/2021.0.0/changelog.xml index a1effec2f225929fe22e4d1f19f37747957a3472..b020b1e6d1dcadcd1c6ddcff09cb36cf57dd4dca 100644 --- a/.liquibase/Data_alias/basic/2021.0.0/changelog.xml +++ b/.liquibase/Data_alias/basic/2021.0.0/changelog.xml @@ -13,4 +13,5 @@ <include relativeToChangelogFile="true" file="Checklists/changelog.xml"/> <include relativeToChangelogFile="true" file="Keywords/changelog.xml"/> <include relativeToChangelogFile="true" file="KeywordMigration/changelog.xml"/> + <include relativeToChangelogFile="true" file="addDateNewToSalesproject.xml"/> </databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/basic/_demoData/generatedData/salesproject.xml b/.liquibase/Data_alias/basic/_demoData/generatedData/salesproject.xml index b02071fcb7dc81c6fead45952d21c67523b1b96d..501abc4a8119a32b98be9512a91506f1fee1b5d7 100644 --- a/.liquibase/Data_alias/basic/_demoData/generatedData/salesproject.xml +++ b/.liquibase/Data_alias/basic/_demoData/generatedData/salesproject.xml @@ -12,6 +12,7 @@ <column name="PROJECTTITLE" value="Erstprojekt"/> <column name="CONTACT_ID" value="dec94545-2487-46d5-978d-26ee0fcf0f5f"/> <column name="STARTDATE" valueDate="2020-05-14T12:00:00"/> + <column name="DATE_NEW" valueDate="2020-01-01T11:22:49"/> <column name="STATUS" value="SALPROJSTATOPEN"/> </insert> <insert tableName="salesproject"> @@ -24,6 +25,7 @@ <column name="PROJECTTITLE" value="Skyscraper / Pilotprojekt"/> <column name="CONTACT_ID" value="fc465f2f-803b-4a1f-b79d-7b466d7ecff4"/> <column name="STARTDATE" valueDate="2020-05-15T12:00:00"/> + <column name="DATE_NEW" valueDate="2020-01-01T11:22:49"/> <column name="STATUS" value="SALPROJSTATOPEN"/> </insert> <insert tableName="salesproject"> @@ -36,6 +38,7 @@ <column name="PROJECTTITLE" value="Kronen Pilotprojekt"/> <column name="CONTACT_ID" value="a3fd3c23-12e1-4820-b76e-2cd70103d94d"/> <column name="STARTDATE" valueDate="2020-05-13T12:00:00"/> + <column name="DATE_NEW" valueDate="2020-01-01T11:22:49"/> <column name="STATUS" value="SALPROJSTATOPEN"/> </insert> <insert tableName="salesproject"> @@ -48,6 +51,7 @@ <column name="PROJECTTITLE" value="Transatlantik Initialprojekt"/> <column name="CONTACT_ID" value="6efb4fab-64f9-4d8e-aa6f-a158d13fc273"/> <column name="STARTDATE" valueDate="2020-05-15T12:00:00"/> + <column name="DATE_NEW" valueDate="2020-01-01T11:22:49"/> <column name="STATUS" value="SALPROJSTATOPEN"/> </insert> <insert tableName="salesproject"> @@ -59,6 +63,7 @@ <column name="PROJECTTITLE" value="Projekt 123"/> <column name="CONTACT_ID" value="fb07cb0e-c391-4503-9c47-a39ec7388f4f"/> <column name="STARTDATE" valueDate="2020-11-24T12:00:00"/> + <column name="DATE_NEW" valueDate="2020-01-01T11:22:49"/> <column name="STATUS" value="SALPROJSTATOPEN"/> </insert> <insert tableName="salesproject"> @@ -71,6 +76,7 @@ <column name="PROJECTTITLE" value="Buchner Neuprojekt"/> <column name="CONTACT_ID" value="019651a4-503e-4e06-aefd-e7e631bf3144"/> <column name="STARTDATE" valueDate="2020-02-05T12:00:00"/> + <column name="DATE_NEW" valueDate="2020-01-01T11:22:49"/> <column name="STATUS" value="SALPROJSTATOPEN"/> </insert> </changeSet> diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod index 2e698e94fb7e85a12cc41b1394634e3f5592f445..ac89a96311b83a8d2f481e4356f63edfa1702118 100644 --- a/aliasDefinition/Data_alias/Data_alias.aod +++ b/aliasDefinition/Data_alias/Data_alias.aod @@ -3786,6 +3786,20 @@ </customStringProperty> </customProperties> </entityFieldDb> + <entityFieldDb> + <name>DATE_NEW</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> </entityFields> </entityDb> <entityDb> diff --git a/entity/360Degree_entity/recordcontainers/jdito/contentProcess.js b/entity/360Degree_entity/recordcontainers/jdito/contentProcess.js index 8f6bf8cf9a87d4c4973130e7769a562086b9463c..a8965c43523db6c703fca77193786658d31b5098 100644 --- a/entity/360Degree_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/360Degree_entity/recordcontainers/jdito/contentProcess.js @@ -34,7 +34,7 @@ function _get360Data(pContactId, pContextList) var filter = vars.get("$sys.filter"); for(var context in pContextList) { - var group = ContextUtils.getTitle(context, true); + var group = context if(pContextList[context].hasOwnProperty("setGroupBy") && pContextList[context].hasOwnProperty("groupByKeyword")) var groupKeyword = Utils.objectFromMap(new Map(KeywordUtils.getEntryNamesAndIdsByContainer(pContextList[context]["groupByKeyword"]))); diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod index fe9f61c2f7b5a8cbe9b2647379015e641ea96be1..ac6d2e755a3059859fd1adb11bc724f80856ea89 100644 --- a/entity/Person_entity/Person_entity.aod +++ b/entity/Person_entity/Person_entity.aod @@ -913,6 +913,7 @@ <title>Company</title> <consumer>Organisations</consumer> <linkedContextProcess>%aditoprj%/entity/Person_entity/entityfields/organisation_contactid/linkedContextProcess.js</linkedContextProcess> + <stateProcess>%aditoprj%/entity/Person_entity/entityfields/organisation_contactid/stateProcess.js</stateProcess> <valueProcess>%aditoprj%/entity/Person_entity/entityfields/organisation_contactid/valueProcess.js</valueProcess> <displayValueProcess>%aditoprj%/entity/Person_entity/entityfields/organisation_contactid/displayValueProcess.js</displayValueProcess> <onValidation>%aditoprj%/entity/Person_entity/entityfields/organisation_contactid/onValidation.js</onValidation> diff --git a/entity/Person_entity/entityfields/organisation_contactid/stateProcess.js b/entity/Person_entity/entityfields/organisation_contactid/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..7d8abdebb5fe1f2471641ff52029303f559bc3e1 --- /dev/null +++ b/entity/Person_entity/entityfields/organisation_contactid/stateProcess.js @@ -0,0 +1,23 @@ +import("Context_lib"); +import("system.vars"); +import("system.result"); +import("Entity_lib"); +import("system.neon"); + +if(vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_EDIT) { + +var currentContext = ContextUtils.getCurrentContextId(); +var contactId = vars.get("$field.CONTACTID"); + +var linkedObject = new HasLinkedObjectTester() +.andNoEntityRows("Activity_entity", "LinkedObjects", {ObjectId_param : currentContext, RowId_param : contactId}) +.andNoEntityRows("360Degree_entity", "PersonObjects", {ObjectRowId_param : contactId , ObjectStatus_param : vars.get("$field.STATUS")}) +.andNoEntityRows("ObjectTree_entity", "TreeProvider", {ObjectIds_param : [vars.get("$field.CONTACTID"), vars.get("$field.PERSON_ID")], ObjectTypes_param : currentContext}) +//.andNoEntityRows("AttributeRelation_entity", "TreeProvider", {ObjectRowId_param : contactId, ObjectType_param : currentContext}) +//.andNoEntityRows("DistrictResponsible_entity", "OrganisationResponsibles", {OrgUid_param : vars.get("$field.ORGANISATION_CONTACTID")}) //District Responsible and Object Tree is default data record +.andNoEntityRows("Document_entity", "Documents", {AssignmentRowId_param : contactId, AssignmentTable_param : "RELATION"}) +.validate() + +if(!linkedObject) + result.string(neon.COMPONENTSTATE_READONLY); +} \ No newline at end of file diff --git a/entity/Productprice_entity/Productprice_entity.aod b/entity/Productprice_entity/Productprice_entity.aod index b28ece7b968231503e48f774f9d7a5531da15b59..20e53fc299aadd601a2a2fed53c8ab2ee8e05b96 100644 --- a/entity/Productprice_entity/Productprice_entity.aod +++ b/entity/Productprice_entity/Productprice_entity.aod @@ -102,6 +102,7 @@ <name>PRICELIST</name> <documentation>%aditoprj%/entity/Productprice_entity/entityfields/pricelist/documentation.adoc</documentation> <title>Price list</title> + <colorProcess>%aditoprj%/entity/Productprice_entity/entityfields/pricelist/colorProcess.js</colorProcess> <consumer>KeywordPricelists</consumer> <state>AUTO</state> <stateProcess>%aditoprj%/entity/Productprice_entity/entityfields/pricelist/stateProcess.js</stateProcess> diff --git a/entity/Productprice_entity/entityfields/image/valueProcess.js b/entity/Productprice_entity/entityfields/image/valueProcess.js index 8ba121f73f08d59b6efda0fbaa02d9761e31b5b3..adbcde4fe369ba6683fcfb308ffbb6ae8c74639c 100644 --- a/entity/Productprice_entity/entityfields/image/valueProcess.js +++ b/entity/Productprice_entity/entityfields/image/valueProcess.js @@ -1,4 +1,4 @@ import("system.vars"); import("system.result"); -result.string("TEXT:" + vars.getString("$field.PRICELIST.displayValue")); \ No newline at end of file +result.string("TEXT:" + vars.getString("$field.PRODUCT_ID.displayValue")); \ No newline at end of file diff --git a/entity/Productprice_entity/entityfields/pricelist/colorProcess.js b/entity/Productprice_entity/entityfields/pricelist/colorProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..df4926b10119acd76184d30eb15a8ea1dc63d4d3 --- /dev/null +++ b/entity/Productprice_entity/entityfields/pricelist/colorProcess.js @@ -0,0 +1,25 @@ +import("system.result"); +import("KeywordRegistry_basic"); +import("system.vars"); +import("system.neon"); + +let color; + +switch (vars.get("$field.PRICELIST")) +{ + case $KeywordRegistry.productPricelist$keyList(): + color = neon.PRIORITY_LOW_COLOR; + break; + case $KeywordRegistry.productPricelist$specialList(): + color = neon.PRIORITY_HIGH_COLOR; + break; + case $KeywordRegistry.productPricelist$serviceList(): + color = neon.PRIORITY_NONE_COLOR + break; + case $KeywordRegistry.productPricelist$standardList(): + default: + color = neon.BRAND_COLOR; + break; +} + +result.string(color); \ No newline at end of file diff --git a/entity/Salesproject_entity/Salesproject_entity.aod b/entity/Salesproject_entity/Salesproject_entity.aod index 5300b1def470341719ee94cd6b833668fef55fbe..614b8dfb0611823b9718868b769666ef01ebd584 100644 --- a/entity/Salesproject_entity/Salesproject_entity.aod +++ b/entity/Salesproject_entity/Salesproject_entity.aod @@ -124,8 +124,7 @@ <outputFormat>dd.MM.yyyy</outputFormat> <inputFormat>dd.MM.yyyy</inputFormat> <groupable v="true" /> - <mandatory v="true" /> - <valueProcess>%aditoprj%/entity/Salesproject_entity/entityfields/startdate/valueProcess.js</valueProcess> + <mandatory v="false" /> </entityField> <entityField> <name>STATUS</name> @@ -825,6 +824,10 @@ </entityField> <entityField> <name>DATE_NEW</name> + <title>Created on</title> + <contentType>DATE</contentType> + <resolution>DAY</resolution> + <valueProcess>%aditoprj%/entity/Salesproject_entity/entityfields/date_new/valueProcess.js</valueProcess> </entityField> <entityField> <name>ACTIVE</name> @@ -1005,7 +1008,8 @@ </dbRecordFieldMapping> <dbRecordFieldMapping> <name>DATE_NEW.value</name> - <recordfield>SALESPROJECT.STARTDATE</recordfield> + <recordfield>SALESPROJECT.DATE_NEW</recordfield> + <isFilterable v="true" /> </dbRecordFieldMapping> <dbRecordFieldMapping> <name>ACTIVE.value</name> diff --git a/entity/Salesproject_entity/entityfields/date_new/valueProcess.js b/entity/Salesproject_entity/entityfields/date_new/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..0c68e0b1ce5d1bcb6519f306dfa01de18c10be7c --- /dev/null +++ b/entity/Salesproject_entity/entityfields/date_new/valueProcess.js @@ -0,0 +1,9 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); + +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) +{ + result.string(vars.get("$sys.date")); +} + \ No newline at end of file diff --git a/entity/Salesproject_entity/entityfields/startdate/valueProcess.js b/entity/Salesproject_entity/entityfields/startdate/valueProcess.js deleted file mode 100644 index 047e11fdb49fe7a57518e928bd5e6436d9f10065..0000000000000000000000000000000000000000 --- a/entity/Salesproject_entity/entityfields/startdate/valueProcess.js +++ /dev/null @@ -1,9 +0,0 @@ -import("system.vars"); -import("system.result"); -import("system.neon"); -import("Date_lib"); - -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null) -{ - result.string(DateUtils.getTodayUTC()); -} \ No newline at end of file diff --git a/neonView/ProductpriceFilter_view/ProductpriceFilter_view.aod b/neonView/ProductpriceFilter_view/ProductpriceFilter_view.aod index 896078f3187b59918e2fdbcd20b65824c5e40cd7..9680051e7399c4618b4de58476ce62cceb09a850 100644 --- a/neonView/ProductpriceFilter_view/ProductpriceFilter_view.aod +++ b/neonView/ProductpriceFilter_view/ProductpriceFilter_view.aod @@ -107,6 +107,7 @@ <element>PRICE</element> <element>VALID_FROM</element> <element>VALID_TO</element> + <element>PRODUCT_ID</element> </editableColumns> <columns> <neonTableColumn> @@ -140,11 +141,18 @@ </columns> <editRendererMapping> <rendererMappingEntry> - <name>cef3f0d1-1976-4c69-add7-49a37893c56b</name> + <name>6bd04999-36b5-4278-a975-a24414058b8e</name> <fieldName>PRICE</fieldName> <renderer>numberInput</renderer> </rendererMappingEntry> </editRendererMapping> + <viewRendererMapping> + <rendererMappingEntry> + <name>cece5a67-394e-4fd2-8b2d-f39660290cee</name> + <fieldName>PRICELIST</fieldName> + <renderer>badge</renderer> + </rendererMappingEntry> + </viewRendererMapping> </multiEditTableViewTemplate> </children> </neonView> diff --git a/neonView/SalesprojectFilter_view/SalesprojectFilter_view.aod b/neonView/SalesprojectFilter_view/SalesprojectFilter_view.aod index b02721165a527986f256ba2d41137c3529fde450..888b2580c7beec222342d1498e8d057d6717eacf 100644 --- a/neonView/SalesprojectFilter_view/SalesprojectFilter_view.aod +++ b/neonView/SalesprojectFilter_view/SalesprojectFilter_view.aod @@ -88,6 +88,10 @@ <name>88e6bebb-e83d-43ec-82f1-cc778fac458e</name> <entityField>CLASSIFICATIONVALUE</entityField> </neonTableColumn> + <neonTableColumn> + <name>c00e5148-54c8-488d-817a-2938e124871b</name> + <entityField>DATE_NEW</entityField> + </neonTableColumn> <neonTableColumn> <name>fec843c3-f7c0-42c7-8295-50386651edb2</name> <entityField>STARTDATE</entityField> @@ -137,6 +141,10 @@ <name>6d9d1365-985a-4357-8ecc-16ddcc201ea8</name> <entityField>CLASSIFICATIONVALUE</entityField> </neonTreeTableColumn> + <neonTreeTableColumn> + <name>c5e66669-4e12-4933-94e9-7db5c7688250</name> + <entityField>DATE_NEW</entityField> + </neonTreeTableColumn> <neonTreeTableColumn> <name>745d6192-4817-49e6-8cb2-8470c9c25f4d</name> <entityField>STARTDATE</entityField> diff --git a/neonView/SalesprojectPreview_view/SalesprojectPreview_view.aod b/neonView/SalesprojectPreview_view/SalesprojectPreview_view.aod index 639a366fda49c2757384fcace20e621ee9267310..db91bfb1b79095049298c48c0484e54c78c05269 100644 --- a/neonView/SalesprojectPreview_view/SalesprojectPreview_view.aod +++ b/neonView/SalesprojectPreview_view/SalesprojectPreview_view.aod @@ -18,6 +18,7 @@ <descriptionField>PROJECTCODE</descriptionField> <favoriteAction1>newActivity</favoriteAction1> <entityField>#ENTITY</entityField> + <informationField>DATE_NEW</informationField> </cardViewTemplate> <favoriteViewTemplate> <name>Favorites</name> diff --git a/process/KeywordRegistry_basic/process.js b/process/KeywordRegistry_basic/process.js index fcb12948f27d859bc23f374130bc4d2a85ffb97f..e9326c6bf15cb78a89fd3117984cbce0fd9c387b 100644 --- a/process/KeywordRegistry_basic/process.js +++ b/process/KeywordRegistry_basic/process.js @@ -82,6 +82,9 @@ $KeywordRegistry.ticketType$supportTicket = function(){return "SUPPORTTICKET";}; $KeywordRegistry.productPricelist = function(){return "ProductPricelist";}; $KeywordRegistry.productPricelist$standardList = function(){return "PRICELISTDEFAULT";}; +$KeywordRegistry.productPricelist$keyList = function(){return "PRICELISTKEY";}; +$KeywordRegistry.productPricelist$specialList = function(){return "PRICELISTSPECIAL";}; +$KeywordRegistry.productPricelist$serviceList = function(){return "PRICELISTSERVICE";}; $KeywordRegistry.quantityUnit = function(){return "QuantityUnit";}; $KeywordRegistry.quantityUnit$pieces = function(){return "QUANTITYPIECES";}; diff --git a/process/Leadimport_lib/process.js b/process/Leadimport_lib/process.js index 422506bef5bea01bb6500bd075ec70a66f6b172a..f651e47b331f80b1cae935be3315b409148bdd4b 100644 --- a/process/Leadimport_lib/process.js +++ b/process/Leadimport_lib/process.js @@ -163,14 +163,15 @@ LeadImportUtils.importData = function(pDataFields, pDataTypes, pFieldDef, pField var orgObjID = ""; var orgsForDubCheck = ""; var persForDubCheck = ""; - var orgRet; + var orgAddressID = null; + var orgRet = [null, null, null, null]; var persRet; //------create organisation if (LeadValues["NAME"].trim() != "")//only if Organame is filled { orgObjID = "Organisation";//for attribute - orgRet = LeadImportUtils.insertOrg(pDataFields, pDataTypes, pFieldDef, pFieldValues, pUser, pDate); + [orgRet[0], orgRet[1], orgRet[2], orgRet[3], orgAddressID] = LeadImportUtils.insertOrg(pDataFields, pDataTypes, pFieldDef, pFieldValues, pUser, pDate); orgid = orgRet[0]; orgContactId = orgRet[1]; @@ -186,7 +187,7 @@ LeadImportUtils.importData = function(pDataFields, pDataTypes, pFieldDef, pField if (LeadValues["LASTNAME"].trim() != "")//only if lastname is filled { persObjID = "Person";//for attribute - persRet = LeadImportUtils.insertPers(pDataFields, pDataTypes, pFieldDef, pFieldValues, orgid, LeadValues, pUser, pDate); + persRet = LeadImportUtils.insertPers(pDataFields, pDataTypes, pFieldDef, pFieldValues, orgid, LeadValues, pUser, pDate, orgAddressID); persid = persRet[0]; persContactId = persRet[1]; @@ -574,11 +575,11 @@ LeadImportUtils.insertOrg = function(pDataFields, pDataTypes, pFieldDef, pField workflow.startProcessByKey("leadprocess", processVariables) } - return new Array(orgid, contactId ,entityFieldValues, true); + return new Array(orgid, contactId ,entityFieldValues, true, ContactValues["ADDRESS_ID"]); } //return the ids of the existing organisation so that people who work for the same organisation are assigned to them // OrgId ContactID - return new Array(ids[0], ids[1] ,entityFieldValues, false); + return new Array(ids[0], ids[1] ,entityFieldValues, false, ids[2]); } /** @@ -595,7 +596,7 @@ LeadImportUtils.insertOrg = function(pDataFields, pDataTypes, pFieldDef, pField * * @return {String []} (personId, contactId, duplicateMapping) */ -LeadImportUtils.insertPers = function(pDataFields, pDataTypes, pFieldDef, pFieldValues, pOrgId, pLeadValues, pUser, pDate) +LeadImportUtils.insertPers = function(pDataFields, pDataTypes, pFieldDef, pFieldValues, pOrgId, pLeadValues, pUser, pDate, pOrgAddressID) { var isoLanguage = pLeadValues["ISOLANGUAGE"]; @@ -611,7 +612,6 @@ LeadImportUtils.insertPers = function(pDataFields, pDataTypes, pFieldDef, pFiel ContactValues["STATUS"] = "CONTACTSTATACTIVE";//only insert active persons ContactValues["PERSON_ID"] = persid; - ContactValues["ADDRESS_ID"] = util.getNewUUID(); ContactValues["DEPARTMENT"] = ContactInfoUtils.getContactDepartment(pLeadValues); ContactValues["CONTACTROLE"] = ContactInfoUtils.getContactRole(pLeadValues); ContactValues["CONTACTPOSITION"] = ContactInfoUtils.getContactPosition(pLeadValues); @@ -624,14 +624,14 @@ LeadImportUtils.insertPers = function(pDataFields, pDataTypes, pFieldDef, pFiel else { ContactValues["ORGANISATION_ID"] = pOrgId; - ContactValues["ADDRESS_ID"] = 0 + ContactValues["ADDRESS_ID"] = pOrgAddressID } var contactId = LeadImportUtils.insertTable(pDataFields, pDataTypes, ContactValues, "CONTACT", pUser, pDate); //Address - if (ContactValues["ADDRESS_ID"]) + if (ContactValues["ADDRESS_ID"] && !ContactValues["ORGANISATION_ID"]) { var AddrValues = LeadImportUtils.setValues(pDataFields["ADDRESS"], pFieldDef, pFieldValues); AddrValues["ADDRESSID"] = ContactValues["ADDRESS_ID"]; @@ -954,7 +954,7 @@ LeadImportUtils.scanLeadDups = function(pAllContactData) LeadImportUtils.checkOrgDup = function(pLeadValues) { // search whether the organisation already exists - var query = newSelect("ORGANISATIONID, CONTACTID") + var query = newSelect(["ORGANISATIONID, CONTACTID, ADDRESSID"]) .from("ORGANISATION") .join("CONTACT", "ORGANISATIONID = CONTACT.ORGANISATION_ID") .join("ADDRESS", "ADDRESSID = ADDRESS_ID");