From 112722314249ff0ffec9fa10dee10171fe79ebe3 Mon Sep 17 00:00:00 2001
From: "j.goderbauer" <j.goderbauer@adito.de>
Date: Mon, 14 Jan 2019 10:24:43 +0100
Subject: [PATCH] =?UTF-8?q?[Projekt:=20Entwicklung=20-=20Neon][TicketNr.:?=
 =?UTF-8?q?=201030874][=20Technische=20Doku=20-=20Review=20und=20Erg=C3=A4?=
 =?UTF-8?q?nzen]=20PERS?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 entity/Pers_entity/Pers_entity.aod                         | 2 ++
 entity/Pers_entity/entityfields/pers_id/documentation.adoc | 1 +
 entity/Pers_entity/entityfields/pers_id/valueProcess.js    | 2 +-
 3 files changed, 4 insertions(+), 1 deletion(-)
 create mode 100644 entity/Pers_entity/entityfields/pers_id/documentation.adoc

diff --git a/entity/Pers_entity/Pers_entity.aod b/entity/Pers_entity/Pers_entity.aod
index 36ea341585..ac33fd7a15 100644
--- a/entity/Pers_entity/Pers_entity.aod
+++ b/entity/Pers_entity/Pers_entity.aod
@@ -146,6 +146,7 @@
     </entityIncomingField>
     <entityField>
       <name>PERS_ID</name>
+      <documentation>%aditoprj%/entity/Pers_entity/entityfields/pers_id/documentation.adoc</documentation>
       <searchable v="false" />
       <valueProcess>%aditoprj%/entity/Pers_entity/entityfields/pers_id/valueProcess.js</valueProcess>
     </entityField>
@@ -153,6 +154,7 @@
       <name>ORG_ID</name>
       <title>Firma</title>
       <linkedContext>Org_context</linkedContext>
+      <mandatory v="true" />
       <outgoingField>PersOrg_dfo</outgoingField>
       <searchable v="false" />
       <valueProcess>%aditoprj%/entity/Pers_entity/entityfields/org_id/valueProcess.js</valueProcess>
diff --git a/entity/Pers_entity/entityfields/pers_id/documentation.adoc b/entity/Pers_entity/entityfields/pers_id/documentation.adoc
new file mode 100644
index 0000000000..e60e1c615b
--- /dev/null
+++ b/entity/Pers_entity/entityfields/pers_id/documentation.adoc
@@ -0,0 +1 @@
+The main reason why this field is needed is that the `RELATION.PERS_ID` has to be set when a new record is inserted (to keep references correct).
\ No newline at end of file
diff --git a/entity/Pers_entity/entityfields/pers_id/valueProcess.js b/entity/Pers_entity/entityfields/pers_id/valueProcess.js
index 53099fc99d..7d2324e0ad 100644
--- a/entity/Pers_entity/entityfields/pers_id/valueProcess.js
+++ b/entity/Pers_entity/entityfields/pers_id/valueProcess.js
@@ -1,4 +1,4 @@
 import("system.vars");
 import("system.result");
-
+//this is needed to set the RELATION-value when a new record is inserted
 result.string(vars.getString("$field.PERSID"));
\ No newline at end of file
-- 
GitLab