From d8c156ddaa431bb262d557fb3f5cb7533a724371 Mon Sep 17 00:00:00 2001
From: "s.pongratz" <s.pongratz@adito.de>
Date: Thu, 20 May 2021 13:13:06 +0200
Subject: [PATCH] =?UTF-8?q?[Projekt:=20xRM-ContactManagement][TicketNr.:?=
 =?UTF-8?q?=201081261][UIDs=20werden=20f=C3=BCr=20Neuanlage=20falsch=20vor?=
 =?UTF-8?q?belegt]?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../entityfields/activitylinkid/valueProcess.js            | 6 ++++--
 .../Address_entity/entityfields/addressid/valueProcess.js  | 7 ++++---
 entity/Campaign_entity/Campaign_entity.aod                 | 2 --
 .../entityfields/communicationid/valueProcess.js           | 6 ++++--
 .../entityfields/contractid/valueProcess.js                | 6 ++++--
 .../entityfields/documenttemplateid/valueProcess.js        | 6 ++++--
 .../entityfields/ab_keyword_categoryid/valueProcess.js     | 3 ++-
 entity/Member_entity/Member_entity.aod                     | 2 --
 entity/ObjectProxy_entity/ObjectProxy_entity.aod           | 2 --
 entity/Offer_entity/Offer_entity.aod                       | 2 --
 .../entityfields/offeritemid/valueProcess.js               | 6 ++++--
 entity/Order_entity/Order_entity.aod                       | 2 --
 .../Order_entity/entityfields/salesorderid/valueProcess.js | 6 ++++--
 .../entityfields/organisationid/valueProcess.js            | 6 ++++--
 entity/Person_entity/entityfields/personid/valueProcess.js | 6 ++++--
 .../entityfields/organisation_id/valueProcess.js           | 6 ++++--
 .../entityfields/person_contact_id/valueProcess.js         | 6 ++++--
 .../entityfields/person_id/valueProcess.js                 | 7 +++++--
 .../entityfields/salesproject_milestoneid/valueProcess.js  | 6 ++++--
 .../entityfields/salutationid/valueProcess.js              | 6 ++++--
 entity/Stock_entity/entityfields/stockid/valueProcess.js   | 6 ++++--
 21 files changed, 63 insertions(+), 42 deletions(-)

diff --git a/entity/ActivityLink_entity/entityfields/activitylinkid/valueProcess.js b/entity/ActivityLink_entity/entityfields/activitylinkid/valueProcess.js
index 86ef789e06..823247cf89 100644
--- a/entity/ActivityLink_entity/entityfields/activitylinkid/valueProcess.js
+++ b/entity/ActivityLink_entity/entityfields/activitylinkid/valueProcess.js
@@ -3,5 +3,7 @@ import("system.vars");
 import("system.result");
 import("system.neon");
 
-if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
-    result.string(util.getNewUUID());
\ No newline at end of file
+if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
+{
+    result.string(util.getNewUUID());
+}
\ No newline at end of file
diff --git a/entity/Address_entity/entityfields/addressid/valueProcess.js b/entity/Address_entity/entityfields/addressid/valueProcess.js
index 6cca32f779..ddcf55571c 100644
--- a/entity/Address_entity/entityfields/addressid/valueProcess.js
+++ b/entity/Address_entity/entityfields/addressid/valueProcess.js
@@ -3,6 +3,7 @@ import("system.result");
 import("system.neon");
 import("system.vars");
 
-
-if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
-    result.string(util.getNewUUID());
\ No newline at end of file
+if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
+{
+    result.string(util.getNewUUID());
+}
\ No newline at end of file
diff --git a/entity/Campaign_entity/Campaign_entity.aod b/entity/Campaign_entity/Campaign_entity.aod
index 7e0c6abd26..7dc6d3ee53 100644
--- a/entity/Campaign_entity/Campaign_entity.aod
+++ b/entity/Campaign_entity/Campaign_entity.aod
@@ -273,8 +273,6 @@
       <title>Charts</title>
       <dependency>
         <name>dependency</name>
-        <entityName>CampaignCostChart_entity</entityName>
-        <fieldName>CostChart</fieldName>
       </dependency>
       <children>
         <entityParameter>
diff --git a/entity/Communication_entity/entityfields/communicationid/valueProcess.js b/entity/Communication_entity/entityfields/communicationid/valueProcess.js
index 86ef789e06..823247cf89 100644
--- a/entity/Communication_entity/entityfields/communicationid/valueProcess.js
+++ b/entity/Communication_entity/entityfields/communicationid/valueProcess.js
@@ -3,5 +3,7 @@ import("system.vars");
 import("system.result");
 import("system.neon");
 
-if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
-    result.string(util.getNewUUID());
\ No newline at end of file
+if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
+{
+    result.string(util.getNewUUID());
+}
\ No newline at end of file
diff --git a/entity/Contract_entity/entityfields/contractid/valueProcess.js b/entity/Contract_entity/entityfields/contractid/valueProcess.js
index 86ef789e06..823247cf89 100644
--- a/entity/Contract_entity/entityfields/contractid/valueProcess.js
+++ b/entity/Contract_entity/entityfields/contractid/valueProcess.js
@@ -3,5 +3,7 @@ import("system.vars");
 import("system.result");
 import("system.neon");
 
-if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
-    result.string(util.getNewUUID());
\ No newline at end of file
+if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
+{
+    result.string(util.getNewUUID());
+}
\ No newline at end of file
diff --git a/entity/DocumentTemplate_entity/entityfields/documenttemplateid/valueProcess.js b/entity/DocumentTemplate_entity/entityfields/documenttemplateid/valueProcess.js
index a2378ee42b..10c60ad094 100644
--- a/entity/DocumentTemplate_entity/entityfields/documenttemplateid/valueProcess.js
+++ b/entity/DocumentTemplate_entity/entityfields/documenttemplateid/valueProcess.js
@@ -3,5 +3,7 @@ import("system.vars");
 import("system.result");
 import("system.neon");
 
-if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
-    result.string(util.getNewUUID());
\ No newline at end of file
+if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
+{
+    result.string(util.getNewUUID());
+}
\ No newline at end of file
diff --git a/entity/KeywordCategory_entity/entityfields/ab_keyword_categoryid/valueProcess.js b/entity/KeywordCategory_entity/entityfields/ab_keyword_categoryid/valueProcess.js
index ad93cec3bf..cd3d2877ed 100644
--- a/entity/KeywordCategory_entity/entityfields/ab_keyword_categoryid/valueProcess.js
+++ b/entity/KeywordCategory_entity/entityfields/ab_keyword_categoryid/valueProcess.js
@@ -4,6 +4,7 @@ import("system.util");
 import("system.vars");
 
 
-if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null) {
+if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
+{
     result.string(util.getNewUUID());
 }
diff --git a/entity/Member_entity/Member_entity.aod b/entity/Member_entity/Member_entity.aod
index 97b8ff6f21..12296888c1 100644
--- a/entity/Member_entity/Member_entity.aod
+++ b/entity/Member_entity/Member_entity.aod
@@ -88,8 +88,6 @@
       <name>Contacts</name>
       <dependency>
         <name>dependency</name>
-        <entityName>Person_entity</entityName>
-        <fieldName>IdFilteredActiveContacts</fieldName>
       </dependency>
       <children>
         <entityParameter>
diff --git a/entity/ObjectProxy_entity/ObjectProxy_entity.aod b/entity/ObjectProxy_entity/ObjectProxy_entity.aod
index de754623cf..925819bf43 100644
--- a/entity/ObjectProxy_entity/ObjectProxy_entity.aod
+++ b/entity/ObjectProxy_entity/ObjectProxy_entity.aod
@@ -128,8 +128,6 @@
       <name>Bulkmails</name>
       <dependency>
         <name>dependency</name>
-        <entityName>BulkMail_entity</entityName>
-        <fieldName>#PROVIDER</fieldName>
       </dependency>
     </entityConsumer>
     <entityConsumer>
diff --git a/entity/Offer_entity/Offer_entity.aod b/entity/Offer_entity/Offer_entity.aod
index 04e18008a2..1207b50efa 100644
--- a/entity/Offer_entity/Offer_entity.aod
+++ b/entity/Offer_entity/Offer_entity.aod
@@ -224,8 +224,6 @@
       <name>AnyContacts</name>
       <dependency>
         <name>dependency</name>
-        <entityName>AnyContact_entity</entityName>
-        <fieldName>OnlySameCompany</fieldName>
       </dependency>
       <children>
         <entityParameter>
diff --git a/entity/Offeritem_entity/entityfields/offeritemid/valueProcess.js b/entity/Offeritem_entity/entityfields/offeritemid/valueProcess.js
index 86ef789e06..823247cf89 100644
--- a/entity/Offeritem_entity/entityfields/offeritemid/valueProcess.js
+++ b/entity/Offeritem_entity/entityfields/offeritemid/valueProcess.js
@@ -3,5 +3,7 @@ import("system.vars");
 import("system.result");
 import("system.neon");
 
-if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
-    result.string(util.getNewUUID());
\ No newline at end of file
+if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
+{
+    result.string(util.getNewUUID());
+}
\ No newline at end of file
diff --git a/entity/Order_entity/Order_entity.aod b/entity/Order_entity/Order_entity.aod
index e1f343fcba..0f5f6fef2a 100644
--- a/entity/Order_entity/Order_entity.aod
+++ b/entity/Order_entity/Order_entity.aod
@@ -462,8 +462,6 @@
       <name>KeywordOrderTypes</name>
       <dependency>
         <name>dependency</name>
-        <entityName>KeywordEntry_entity</entityName>
-        <fieldName>SpecificContainerKeywords</fieldName>
       </dependency>
       <children>
         <entityParameter>
diff --git a/entity/Order_entity/entityfields/salesorderid/valueProcess.js b/entity/Order_entity/entityfields/salesorderid/valueProcess.js
index 86ef789e06..823247cf89 100644
--- a/entity/Order_entity/entityfields/salesorderid/valueProcess.js
+++ b/entity/Order_entity/entityfields/salesorderid/valueProcess.js
@@ -3,5 +3,7 @@ import("system.vars");
 import("system.result");
 import("system.neon");
 
-if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
-    result.string(util.getNewUUID());
\ No newline at end of file
+if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
+{
+    result.string(util.getNewUUID());
+}
\ No newline at end of file
diff --git a/entity/Organisation_entity/entityfields/organisationid/valueProcess.js b/entity/Organisation_entity/entityfields/organisationid/valueProcess.js
index 056f5c94f1..2f2038a392 100644
--- a/entity/Organisation_entity/entityfields/organisationid/valueProcess.js
+++ b/entity/Organisation_entity/entityfields/organisationid/valueProcess.js
@@ -3,5 +3,7 @@ import("system.result");
 import("system.neon");
 import("system.util");
 
-if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
-    result.string(util.getNewUUID());
\ No newline at end of file
+if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
+{
+    result.string(util.getNewUUID());
+}
\ No newline at end of file
diff --git a/entity/Person_entity/entityfields/personid/valueProcess.js b/entity/Person_entity/entityfields/personid/valueProcess.js
index 86ef789e06..293bbaf034 100644
--- a/entity/Person_entity/entityfields/personid/valueProcess.js
+++ b/entity/Person_entity/entityfields/personid/valueProcess.js
@@ -3,5 +3,7 @@ import("system.vars");
 import("system.result");
 import("system.neon");
 
-if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
-    result.string(util.getNewUUID());
\ No newline at end of file
+if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
+{
+    result.string(util.getNewUUID());
+}
\ No newline at end of file
diff --git a/entity/QuickEntry_entity/entityfields/organisation_id/valueProcess.js b/entity/QuickEntry_entity/entityfields/organisation_id/valueProcess.js
index 24b4e17505..663cf5f658 100644
--- a/entity/QuickEntry_entity/entityfields/organisation_id/valueProcess.js
+++ b/entity/QuickEntry_entity/entityfields/organisation_id/valueProcess.js
@@ -3,5 +3,7 @@ import("system.vars");
 import("system.util");
 import("system.result");
 
-if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
-    result.string(util.getNewUUID());
\ No newline at end of file
+if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
+{
+    result.string(util.getNewUUID());
+}
\ No newline at end of file
diff --git a/entity/QuickEntry_entity/entityfields/person_contact_id/valueProcess.js b/entity/QuickEntry_entity/entityfields/person_contact_id/valueProcess.js
index 24b4e17505..663cf5f658 100644
--- a/entity/QuickEntry_entity/entityfields/person_contact_id/valueProcess.js
+++ b/entity/QuickEntry_entity/entityfields/person_contact_id/valueProcess.js
@@ -3,5 +3,7 @@ import("system.vars");
 import("system.util");
 import("system.result");
 
-if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
-    result.string(util.getNewUUID());
\ No newline at end of file
+if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
+{
+    result.string(util.getNewUUID());
+}
\ No newline at end of file
diff --git a/entity/QuickEntry_entity/entityfields/person_id/valueProcess.js b/entity/QuickEntry_entity/entityfields/person_id/valueProcess.js
index 24b4e17505..363f6bcdd8 100644
--- a/entity/QuickEntry_entity/entityfields/person_id/valueProcess.js
+++ b/entity/QuickEntry_entity/entityfields/person_id/valueProcess.js
@@ -3,5 +3,8 @@ import("system.vars");
 import("system.util");
 import("system.result");
 
-if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
-    result.string(util.getNewUUID());
\ No newline at end of file
+if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
+{
+    result.string(util.getNewUUID());
+}
+    
\ No newline at end of file
diff --git a/entity/SalesprojectMilestone_entity/entityfields/salesproject_milestoneid/valueProcess.js b/entity/SalesprojectMilestone_entity/entityfields/salesproject_milestoneid/valueProcess.js
index 86ef789e06..823247cf89 100644
--- a/entity/SalesprojectMilestone_entity/entityfields/salesproject_milestoneid/valueProcess.js
+++ b/entity/SalesprojectMilestone_entity/entityfields/salesproject_milestoneid/valueProcess.js
@@ -3,5 +3,7 @@ import("system.vars");
 import("system.result");
 import("system.neon");
 
-if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
-    result.string(util.getNewUUID());
\ No newline at end of file
+if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
+{
+    result.string(util.getNewUUID());
+}
\ No newline at end of file
diff --git a/entity/Salutation_entity/entityfields/salutationid/valueProcess.js b/entity/Salutation_entity/entityfields/salutationid/valueProcess.js
index b00a74fd01..885ed2edec 100644
--- a/entity/Salutation_entity/entityfields/salutationid/valueProcess.js
+++ b/entity/Salutation_entity/entityfields/salutationid/valueProcess.js
@@ -3,5 +3,7 @@ import("system.neon");
 import("system.result");
 import("system.vars");
 
-if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
-    result.string(util.getNewUUID());
\ No newline at end of file
+if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
+{
+    result.string(util.getNewUUID());
+}
\ No newline at end of file
diff --git a/entity/Stock_entity/entityfields/stockid/valueProcess.js b/entity/Stock_entity/entityfields/stockid/valueProcess.js
index 86ef789e06..823247cf89 100644
--- a/entity/Stock_entity/entityfields/stockid/valueProcess.js
+++ b/entity/Stock_entity/entityfields/stockid/valueProcess.js
@@ -3,5 +3,7 @@ import("system.vars");
 import("system.result");
 import("system.neon");
 
-if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
-    result.string(util.getNewUUID());
\ No newline at end of file
+if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
+{
+    result.string(util.getNewUUID());
+}
\ No newline at end of file
-- 
GitLab