From 50818c131416f911c83307b476cb6ac2438ed6e4 Mon Sep 17 00:00:00 2001
From: "c.wimmer" <c.wimmer@cwimmer-nb.aditosoftware.local>
Date: Mon, 16 Nov 2020 18:13:36 +0100
Subject: [PATCH] =?UTF-8?q?[Projekt:=20Crowd-Development=20/=20Besuch=20vo?=
 =?UTF-8?q?r=20Ort][TicketNr.:=201068891][Pr=C3=BCfen=20ob=20der=20Status?=
 =?UTF-8?q?=20noch=20ben=C3=B6tigt=20wird]?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../entityfields/newvisitplanentry/onActionProcess.js         | 1 +
 .../entityfields/newvisitplanentry/onActionProcess.js         | 1 +
 entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod        | 1 +
 .../entityfields/organisation_contact_id/valueProcess.js      | 4 ++--
 4 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/entity/Organisation_entity/entityfields/newvisitplanentry/onActionProcess.js b/entity/Organisation_entity/entityfields/newvisitplanentry/onActionProcess.js
index f32b45bbbf..3c74f21974 100644
--- a/entity/Organisation_entity/entityfields/newvisitplanentry/onActionProcess.js
+++ b/entity/Organisation_entity/entityfields/newvisitplanentry/onActionProcess.js
@@ -5,5 +5,6 @@ var params = {};
 
 params["NoVisitPlanEmployeeWeek_param"] = true;
 params["ContactId_param"] = vars.get("$field.CONTACTID");
+params["OrganisationId_param"] = vars.get("$field.CONTACTID");
 
 neon.openContext("VisitPlanEntry", "VisitPlanEntryEdit_view", null, neon.OPERATINGSTATE_NEW, params);
\ No newline at end of file
diff --git a/entity/Person_entity/entityfields/newvisitplanentry/onActionProcess.js b/entity/Person_entity/entityfields/newvisitplanentry/onActionProcess.js
index f32b45bbbf..3c74f21974 100644
--- a/entity/Person_entity/entityfields/newvisitplanentry/onActionProcess.js
+++ b/entity/Person_entity/entityfields/newvisitplanentry/onActionProcess.js
@@ -5,5 +5,6 @@ var params = {};
 
 params["NoVisitPlanEmployeeWeek_param"] = true;
 params["ContactId_param"] = vars.get("$field.CONTACTID");
+params["OrganisationId_param"] = vars.get("$field.CONTACTID");
 
 neon.openContext("VisitPlanEntry", "VisitPlanEntryEdit_view", null, neon.OPERATINGSTATE_NEW, params);
\ No newline at end of file
diff --git a/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod b/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod
index e8c7c0ba81..24667b6aca 100644
--- a/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod
+++ b/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod
@@ -27,6 +27,7 @@
       <name>STATUS</name>
       <title>Status</title>
       <consumer>KeywordVisitPlanEntryStatus</consumer>
+      <state>INVISIBLE</state>
       <valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/status/valueProcess.js</valueProcess>
       <displayValueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/status/displayValueProcess.js</displayValueProcess>
     </entityField>
diff --git a/entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/valueProcess.js
index ac8c851516..2b90b66856 100644
--- a/entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/valueProcess.js
+++ b/entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/valueProcess.js
@@ -4,11 +4,11 @@ import("system.result");
 import("system.vars");
 
 if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null 
-    && vars.exists("$param.ContactId_param") && vars.get("$param.ContactId_param"))
+    && vars.exists("$param.OrganisationId_param") && vars.get("$param.OrganisationId_param"))
 {
     
     var OrgId = newSelect("CONTACT.ORGANISATION_ID").from("CONTACT")
-        .where("CONTACT.CONTACTID", vars.get("$param.ContactId_param"))
+        .where("CONTACT.CONTACTID", vars.get("$param.OrganisationId_param"))
         .cell()
     
     var contactIdWithoutPerson = newSelect("CONTACT.CONTACTID").from("CONTACT")
-- 
GitLab