From 6b16ba29e7b33aef0d25f05a79d500e2f0efb71f Mon Sep 17 00:00:00 2001
From: Johannes Hoermann <j.hoermann@adito.de>
Date: Mon, 4 Mar 2019 11:34:36 +0100
Subject: [PATCH] test

---
 entity/Person_entity/Person_entity.aod        |  1 -
 .../salutation/displayValueProcess.js         | 14 +++++------
 .../salutation/possibleItemsProcess.js        |  0
 .../Salutation_entity/Salutation_entity.aod   | 25 +++++++++++++++++--
 .../salutations/children/retval/code.js       |  2 ++
 .../contentProcess.js                         |  3 ++-
 .../title_jdito/contentProcess.js             |  3 ++-
 7 files changed, 36 insertions(+), 12 deletions(-)
 delete mode 100644 entity/Person_entity/entityfields/salutation/possibleItemsProcess.js
 create mode 100644 entity/Salutation_entity/entityfields/salutations/children/retval/code.js

diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod
index e127be7bea..1c5af54df2 100644
--- a/entity/Person_entity/Person_entity.aod
+++ b/entity/Person_entity/Person_entity.aod
@@ -49,7 +49,6 @@
       <name>SALUTATION</name>
       <title>Salutation</title>
       <consumer>Salutations</consumer>
-      <possibleItemsProcess>%aditoprj%/entity/Person_entity/entityfields/salutation/possibleItemsProcess.js</possibleItemsProcess>
       <displayValueProcess>%aditoprj%/entity/Person_entity/entityfields/salutation/displayValueProcess.js</displayValueProcess>
     </entityField>
     <entityField>
diff --git a/entity/Person_entity/entityfields/salutation/displayValueProcess.js b/entity/Person_entity/entityfields/salutation/displayValueProcess.js
index 23500893cc..e7bc31ecae 100644
--- a/entity/Person_entity/entityfields/salutation/displayValueProcess.js
+++ b/entity/Person_entity/entityfields/salutation/displayValueProcess.js
@@ -1,7 +1,7 @@
-import("system.vars");
-import("system.db");
-import("system.result");
-import("Sql_lib");
-
-var cond = SqlCondition.begin()
-result.string(db.cell(cond.andPrepareVars("PERSON.PERSONID", "$field.PERSONID").buildSql("select SALUTATION from PERSON", "1=2")));
\ No newline at end of file
+//import("system.vars");
+//import("system.db");
+//import("system.result");
+//import("Sql_lib");
+//
+//var cond = SqlCondition.begin()
+//result.string(db.cell(cond.andPrepareVars("PERSON.PERSONID", "$field.PERSONID").buildSql("select SALUTATION from PERSON", "1=2")));
\ No newline at end of file
diff --git a/entity/Person_entity/entityfields/salutation/possibleItemsProcess.js b/entity/Person_entity/entityfields/salutation/possibleItemsProcess.js
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/entity/Salutation_entity/Salutation_entity.aod b/entity/Salutation_entity/Salutation_entity.aod
index 9a1e05fce9..0ac244944f 100644
--- a/entity/Salutation_entity/Salutation_entity.aod
+++ b/entity/Salutation_entity/Salutation_entity.aod
@@ -4,11 +4,10 @@
   <title>Anrede</title>
   <majorModelMode>DISTRIBUTED</majorModelMode>
   <titleProcess>%aditoprj%/entity/Salutation_entity/titleProcess.js</titleProcess>
-  <recordContainer>distinctSalutation_jdito</recordContainer>
+  <recordContainer>db</recordContainer>
   <entityFields>
     <entityProvider>
       <name>#PROVIDER</name>
-      <recordContainer>db</recordContainer>
     </entityProvider>
     <entityField>
       <name>SALUTATIONID</name>
@@ -88,6 +87,11 @@
           <expose v="true" />
           <triggerRecalculation v="true" />
         </entityParameter>
+        <entityParameter>
+          <name>retval</name>
+          <code>%aditoprj%/entity/Salutation_entity/entityfields/salutations/children/retval/code.js</code>
+          <expose v="false" />
+        </entityParameter>
       </children>
     </entityProvider>
     <entityProvider>
@@ -104,6 +108,12 @@
           <isConsumer v="false" />
         </entityDependency>
       </dependencies>
+      <children>
+        <entityParameter>
+          <name>retval</name>
+          <expose v="false" />
+        </entityParameter>
+      </children>
     </entityProvider>
     <entityParameter>
       <name>Language_param</name>
@@ -130,6 +140,14 @@
       <mandatory v="false" />
       <description>PARAMETER</description>
     </entityParameter>
+    <entityField>
+      <name>DISTINCT_RETVAL</name>
+    </entityField>
+    <entityParameter>
+      <name>retval</name>
+      <expose v="true" />
+      <description>PARAMETER</description>
+    </entityParameter>
   </entityFields>
   <recordContainers>
     <dbRecordContainer>
@@ -207,5 +225,8 @@
         <element>UID.value</element>
       </recordFields>
     </jDitoRecordContainer>
+    <jDitoRecordContainer>
+      <name>distinctAny</name>
+    </jDitoRecordContainer>
   </recordContainers>
 </entity>
diff --git a/entity/Salutation_entity/entityfields/salutations/children/retval/code.js b/entity/Salutation_entity/entityfields/salutations/children/retval/code.js
new file mode 100644
index 0000000000..c03d064f10
--- /dev/null
+++ b/entity/Salutation_entity/entityfields/salutations/children/retval/code.js
@@ -0,0 +1,2 @@
+import("system.result");
+result.string("salutation")
\ No newline at end of file
diff --git a/entity/Salutation_entity/recordcontainers/distinctsalutation_jdito/contentProcess.js b/entity/Salutation_entity/recordcontainers/distinctsalutation_jdito/contentProcess.js
index bc7f9eb2ad..bdebb34ec8 100644
--- a/entity/Salutation_entity/recordcontainers/distinctsalutation_jdito/contentProcess.js
+++ b/entity/Salutation_entity/recordcontainers/distinctsalutation_jdito/contentProcess.js
@@ -1,9 +1,10 @@
+import("system.logging");
 import("system.vars");
 import("system.result");
 import("system.db");
 import("Sql_lib");
 
-
+logging.log("salutation")
 var cond = SqlCondition.begin()
     .and("SALUTATION is not NULL")
     .andPrepareVars("SALUTATION.LANGUAGE", "$param.Language_param")
diff --git a/entity/Salutation_entity/recordcontainers/title_jdito/contentProcess.js b/entity/Salutation_entity/recordcontainers/title_jdito/contentProcess.js
index 76ec7bc49b..c875f3fbbb 100644
--- a/entity/Salutation_entity/recordcontainers/title_jdito/contentProcess.js
+++ b/entity/Salutation_entity/recordcontainers/title_jdito/contentProcess.js
@@ -1,9 +1,10 @@
+import("system.logging");
 import("system.vars");
 import("system.result");
 import("system.db");
 import("Sql_lib");
 
-
+logging.log("title")
 
 var cond = SqlCondition.begin()
     .and("TITLE is not NULL")
-- 
GitLab