From c61acbdafb40878c64f2f6f366993fc54c49ddf7 Mon Sep 17 00:00:00 2001
From: Markus Escher <m.escher@adito.de>
Date: Tue, 26 Feb 2019 14:14:09 +0100
Subject: [PATCH] #1030775 add Salesproject Consumer + Viewreference to
 Organisation

---
 .../Organisation_entity/Organisation_entity.aod  | 16 ++++++++++++++++
 .../children/contactid_param/code.js             |  3 +++
 .../Salesproject_entity/Salesproject_entity.aod  |  6 ++++++
 .../OrganisationMain_view.aod                    |  5 +++++
 4 files changed, 30 insertions(+)
 create mode 100644 entity/Organisation_entity/entityfields/salesprojects/children/contactid_param/code.js

diff --git a/entity/Organisation_entity/Organisation_entity.aod b/entity/Organisation_entity/Organisation_entity.aod
index 844a65942f..277ee16247 100644
--- a/entity/Organisation_entity/Organisation_entity.aod
+++ b/entity/Organisation_entity/Organisation_entity.aod
@@ -476,6 +476,22 @@
         <fieldName>LanguagesISO3Code</fieldName>
       </dependency>
     </entityConsumer>
+    <entityConsumer>
+      <name>Salesprojects</name>
+      <title>Salesprojects</title>
+      <fieldType>DEPENDENCY_OUT</fieldType>
+      <dependency>
+        <name>dependency</name>
+        <entityName>Salesproject_entity</entityName>
+        <fieldName>#PROVIDER</fieldName>
+      </dependency>
+      <children>
+        <entityParameter>
+          <name>ContactId_param</name>
+          <code>%aditoprj%/entity/Organisation_entity/entityfields/salesprojects/children/contactid_param/code.js</code>
+        </entityParameter>
+      </children>
+    </entityConsumer>
   </entityFields>
   <recordContainers>
     <dbRecordContainer>
diff --git a/entity/Organisation_entity/entityfields/salesprojects/children/contactid_param/code.js b/entity/Organisation_entity/entityfields/salesprojects/children/contactid_param/code.js
new file mode 100644
index 0000000000..fb6ae92cf5
--- /dev/null
+++ b/entity/Organisation_entity/entityfields/salesprojects/children/contactid_param/code.js
@@ -0,0 +1,3 @@
+import("system.vars");
+import("system.result");
+result.string(vars.get("$field.ORGANISATION_ID"));
\ No newline at end of file
diff --git a/entity/Salesproject_entity/Salesproject_entity.aod b/entity/Salesproject_entity/Salesproject_entity.aod
index dddedee3f5..20e6365518 100644
--- a/entity/Salesproject_entity/Salesproject_entity.aod
+++ b/entity/Salesproject_entity/Salesproject_entity.aod
@@ -22,6 +22,12 @@
           <fieldName>Salesprojects</fieldName>
           <isConsumer v="false" />
         </entityDependency>
+        <entityDependency>
+          <name>ca678fae-46ce-4818-9661-cfc30f540234</name>
+          <entityName>Organisation_entity</entityName>
+          <fieldName>Salesprojects</fieldName>
+          <isConsumer v="false" />
+        </entityDependency>
       </dependencies>
     </entityProvider>
     <entityField>
diff --git a/neonView/OrganisationMain_view/OrganisationMain_view.aod b/neonView/OrganisationMain_view/OrganisationMain_view.aod
index 804bbee490..ef3e97b5d0 100644
--- a/neonView/OrganisationMain_view/OrganisationMain_view.aod
+++ b/neonView/OrganisationMain_view/OrganisationMain_view.aod
@@ -50,5 +50,10 @@
       <entityField>ObjectRelations</entityField>
       <view>AnyObjectRelationFilter_view</view>
     </neonViewReference>
+    <neonViewReference>
+      <name>dc1aa0ca-d0bd-45fd-84dc-55cfcf3ca430</name>
+      <entityField>Salesprojects</entityField>
+      <view>SalesprojectFilter_view</view>
+    </neonViewReference>
   </children>
 </neonView>
-- 
GitLab