Skip to content
Snippets Groups Projects
Commit 927516c7 authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

relations

parent 9ea46fc0
No related branches found
No related tags found
No related merge requests found
...@@ -109,7 +109,6 @@ ...@@ -109,7 +109,6 @@
<fieldType>DEPENDENCY_IN</fieldType> <fieldType>DEPENDENCY_IN</fieldType>
<targetContextField>OtherObjectType</targetContextField> <targetContextField>OtherObjectType</targetContextField>
<targetIdField>OtherObjectRowid</targetIdField> <targetIdField>OtherObjectRowid</targetIdField>
<recordContainer>db</recordContainer>
<dependencies> <dependencies>
<entityDependency> <entityDependency>
<name>30a7c954-3127-4ceb-9838-a0b7b55d0c8c</name> <name>30a7c954-3127-4ceb-9838-a0b7b55d0c8c</name>
...@@ -117,6 +116,12 @@ ...@@ -117,6 +116,12 @@
<fieldName>ObjectRelations</fieldName> <fieldName>ObjectRelations</fieldName>
<isConsumer v="false" /> <isConsumer v="false" />
</entityDependency> </entityDependency>
<entityDependency>
<name>3f268dec-4672-4de0-98b2-7616f344248f</name>
<entityName>Organisation_entity</entityName>
<fieldName>ObjectRelations</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies> </dependencies>
<children> <children>
<entityParameter> <entityParameter>
......
import("system.logging");
import("system.db"); import("system.db");
import("system.result"); import("system.result");
import("system.vars"); import("system.vars");
...@@ -10,18 +9,20 @@ if (vars.exists("$field.OtherObjectType") && vars.get("$field.OtherObjectType") ...@@ -10,18 +9,20 @@ if (vars.exists("$field.OtherObjectType") && vars.get("$field.OtherObjectType")
{ {
var attributes = KeywordUtils.getAttributeRelationsByKey(vars.get("$field.RELATION_TYPE"), $KeywordRegistry.objectRelationType()); var attributes = KeywordUtils.getAttributeRelationsByKey(vars.get("$field.RELATION_TYPE"), $KeywordRegistry.objectRelationType());
var currentObjectNum = vars.get("$field.CurrentObjectNumber"); var currentObjectNum = vars.get("$field.CurrentObjectNumber");
logging.log(currentObjectNum.toSource())
var name = ""; var name = "";
switch (currentObjectNum) switch (currentObjectNum)
{ {
case "1": case "1":
name = attributes.Object2Title; // if second title doesn't exist, it is same like the first one.
if (attributes.Object2Title == null)
name = attributes.Object1Title;
else
name = attributes.Object2Title;
break; break;
case "2": case "2":
name = attributes.Object1Title; name = attributes.Object1Title;
break; break;
} }
logging.log(attributes.toSource())
logging.log(name.toSource())
result.string(name); result.string(name);
} }
\ No newline at end of file
...@@ -425,7 +425,19 @@ ...@@ -425,7 +425,19 @@
<fieldType>DEPENDENCY_OUT</fieldType> <fieldType>DEPENDENCY_OUT</fieldType>
<dependency> <dependency>
<name>dependency</name> <name>dependency</name>
<entityName>ObjectRelation_entity</entityName>
<fieldName>ObjectRelations</fieldName>
</dependency> </dependency>
<children>
<entityParameter>
<name>ObjectRowid_param</name>
<code>%aditoprj%/entity/Organisation_entity/entityfields/objectrelations/children/objectrowid_param/code.js</code>
</entityParameter>
<entityParameter>
<name>ObjectType_param</name>
<code>%aditoprj%/entity/Organisation_entity/entityfields/objectrelations/children/objecttype_param/code.js</code>
</entityParameter>
</children>
</entityConsumer> </entityConsumer>
<entityConsumer> <entityConsumer>
<name>KeywordContactStates</name> <name>KeywordContactStates</name>
...@@ -527,6 +539,22 @@ ...@@ -527,6 +539,22 @@
<name>dependency</name> <name>dependency</name>
</dependency> </dependency>
</entityConsumer> </entityConsumer>
<entityConsumer>
<name>Salesprojects</name>
<title>Salesprojects</title>
<fieldType>DEPENDENCY_OUT</fieldType>
<dependency>
<name>dependency</name>
<entityName>Salesproject_entity</entityName>
<fieldName>Salesprojects</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> </entityFields>
<recordContainers> <recordContainers>
<dbRecordContainer> <dbRecordContainer>
......
import("system.vars");
import("system.result");
result.string(vars.get("$field.ORGANISATIONID"));
\ No newline at end of file
import("system.result");
import("Context_lib");
result.string(ContextUtils.getCurrentContextId());
\ No newline at end of file
...@@ -40,16 +40,16 @@ ...@@ -40,16 +40,16 @@
<entityField>Contracts</entityField> <entityField>Contracts</entityField>
<view>ContractFilter_view</view> <view>ContractFilter_view</view>
</neonViewReference> </neonViewReference>
<neonViewReference>
<name>ee7395b9-b787-4662-9021-f6e2d486bd16</name>
<entityField>ObjectRelations</entityField>
<view>ObjectRelationFilter_view</view>
</neonViewReference>
<neonViewReference> <neonViewReference>
<name>39c98ccb-7f77-4df0-818f-1f302f69fec4</name> <name>39c98ccb-7f77-4df0-818f-1f302f69fec4</name>
<entityField>Attributes</entityField> <entityField>Attributes</entityField>
<view>AttributeRelationFilter_view</view> <view>AttributeRelationFilter_view</view>
</neonViewReference> </neonViewReference>
<neonViewReference>
<name>ee7395b9-b787-4662-9021-f6e2d486bd16</name>
<entityField>ObjectRelations</entityField>
<view>AnyObjectRelationFilter_view</view>
</neonViewReference>
<neonViewReference> <neonViewReference>
<name>dc1aa0ca-d0bd-45fd-84dc-55cfcf3ca430</name> <name>dc1aa0ca-d0bd-45fd-84dc-55cfcf3ca430</name>
<entityField>Salesprojects</entityField> <entityField>Salesprojects</entityField>
......
...@@ -237,7 +237,7 @@ ...@@ -237,7 +237,7 @@
<insert tableName="AB_KEYWORD_ENTRY"> <insert tableName="AB_KEYWORD_ENTRY">
<column name="AB_KEYWORD_ENTRYID" value="ba666b30-27b0-46ba-8ea7-442518cb862f"/> <column name="AB_KEYWORD_ENTRYID" value="ba666b30-27b0-46ba-8ea7-442518cb862f"/>
<column name="KEYID" value="600cd496-c7c1-4be0-a339-76f057711025"/> <column name="KEYID" value="a19802ad-f5aa-47dc-abb3-02791a4aa7ac"/>
<column name="TITLE" value="competitor"/> <column name="TITLE" value="competitor"/>
<column name="CONTAINER" value="ObjectRelationType"/> <column name="CONTAINER" value="ObjectRelationType"/>
<column name="SORTING" valueNumeric="5"/> <column name="SORTING" valueNumeric="5"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment