From b5afda430322156b95dd8e36c8e2a89953550f35 Mon Sep 17 00:00:00 2001
From: "a.voegl" <a.voegl@adito.de>
Date: Tue, 20 Oct 2020 10:39:16 +0200
Subject: [PATCH] shrink unnecessary code

---
 .../recordcontainers/jdito/contentProcess.js               | 4 ++--
 entity/Salesproject_entity/Salesproject_entity.aod         | 7 +++++++
 process/Context_lib/process.js                             | 5 +----
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/entity/360Degree_entity/recordcontainers/jdito/contentProcess.js b/entity/360Degree_entity/recordcontainers/jdito/contentProcess.js
index be441660fd..c22aa1e7ac 100644
--- a/entity/360Degree_entity/recordcontainers/jdito/contentProcess.js
+++ b/entity/360Degree_entity/recordcontainers/jdito/contentProcess.js
@@ -35,7 +35,7 @@ function _get360Data(pContactId, pContextList)
     for(var i = 0; i < pContextList.length; i++)
     {
         var res = ContextUtils.getContextDataSqlviaReadEntity(pContextList[i], pContactId);
-        res.data.forEach(function (row) 
+        res.forEach(function (row) 
         {
             var targetid = row["#UID"];
             var title = row["#CONTENTTITLE"];
@@ -52,7 +52,7 @@ function _get360Data(pContactId, pContextList)
                 description,                            // DESCRIPTION
                 dataDate,                               // DATE
                 dataDate,                               // YEAR
-                res.entity,                             // ENTITY_NAME
+                ContextUtils.getEntity(pContextList[i]),// ENTITY_NAME
                 translate.text(group)                   // GROUP
                 ]); 
         });
diff --git a/entity/Salesproject_entity/Salesproject_entity.aod b/entity/Salesproject_entity/Salesproject_entity.aod
index f33a339122..69194f215d 100644
--- a/entity/Salesproject_entity/Salesproject_entity.aod
+++ b/entity/Salesproject_entity/Salesproject_entity.aod
@@ -751,6 +751,9 @@
       <title>Classification</title>
       <groupable v="true" />
     </entityField>
+    <entityField>
+      <name>DATE_NEW</name>
+    </entityField>
   </entityFields>
   <recordContainers>
     <dbRecordContainer>
@@ -902,6 +905,10 @@
           <recordfield>CLASSIFICATIONSTORAGE.CLASSIFICATIONVALUE</recordfield>
           <isFilterable v="true" />
         </dbRecordFieldMapping>
+        <dbRecordFieldMapping>
+          <name>DATE_NEW.value</name>
+          <recordfield>SALESPROJECT.STARTDATE</recordfield>
+        </dbRecordFieldMapping>
       </recordFieldMappings>
       <filterExtensions>
         <filterExtensionSet>
diff --git a/process/Context_lib/process.js b/process/Context_lib/process.js
index 20a9fcc365..589b16695a 100644
--- a/process/Context_lib/process.js
+++ b/process/Context_lib/process.js
@@ -717,10 +717,7 @@ ContextUtils.getContextDataSqlviaReadEntity = function(pContextId, pContactId)
             throw new Error(translate.text("Some prereserved EntityFields which are necessary fot 360° are not available. Context: "+pContextId
             +" Data: "+JSON.stringify(res)));
     }
-    return {
-        "entity":ContextUtils.getEntity(pContextId),
-        "data": res
-    };
+    return res;
 }
 
 /**
-- 
GitLab