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

refactor value processes: use this.value

parent 567c196e
No related branches found
No related tags found
No related merge requests found
Showing
with 44 additions and 47 deletions
import("system.result");
import("system.vars");
result.string(vars.get("$field.ACTIVITYID"));
\ No newline at end of file
...@@ -6,7 +6,7 @@ import("system.result"); ...@@ -6,7 +6,7 @@ import("system.result");
/** /**
* Following if() is only for passing param-parts from "new Appointment"-Dialog to AppointmentEditViewTemplate * Following if() is only for passing param-parts from "new Appointment"-Dialog to AppointmentEditViewTemplate
*/ */
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.Entry_param") && !vars.get("$field.SUMMARY")) if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.Entry_param") && vars.get("$this.value") == null)
{ {
var event = JSON.parse(vars.getString("$param.Entry_param")); var event = JSON.parse(vars.getString("$param.Entry_param"));
...@@ -14,4 +14,4 @@ if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$para ...@@ -14,4 +14,4 @@ if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$para
result.string(event[calendars.SUMMARY]); result.string(event[calendars.SUMMARY]);
} }
else else
result.string(vars.get("$field.SUMMARY")); result.string(vars.get("$this.value"));
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,7 @@ import("system.vars"); ...@@ -2,7 +2,7 @@ import("system.vars");
import("system.result"); import("system.result");
import("system.util"); import("system.util");
if(!(vars.get("$field.UID"))) if(!(vars.get("$this.value")))
result.string(util.getNewUUID()); result.string(util.getNewUUID());
else else
result.string(vars.get("$field.UID")); result.string(vars.get("$this.value"));
\ No newline at end of file \ No newline at end of file
import("system.vars"); import("system.vars");
import("system.result"); import("system.result");
import("system.neon"); import("system.neon");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.AttributeId_param") && vars.get("$param.AttributeId_param") != null) if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.AttributeId_param") && vars.get("$param.AttributeId_param") != null)
result.string(vars.get("$param.AttributeId_param")); result.string(vars.get("$param.AttributeId_param"));
else if (vars.get("$field.AB_ATTRIBUTE_ID")) else if (vars.get("$this.value"))
result.string(vars.get("$field.AB_ATTRIBUTE_ID")); result.string(vars.get("$this.value"));
\ No newline at end of file \ No newline at end of file
import("system.vars"); import("system.vars");
import("system.result"); import("system.result");
import("Attribute_lib"); import("Attribute_lib");
var name = vars.get("$field.ATTRIBUTE_NAME"); var name = vars.get("$this.value");
if (!(vars.exists("$param.DisplaySimpleName_param") && vars.get("$param.DisplaySimpleName_param"))) if (!(vars.exists("$param.DisplaySimpleName_param") && vars.get("$param.DisplaySimpleName_param")))
{ {
var parentName = AttributeUtil.getFullAttributeName(vars.get("$field.ATTRIBUTE_PARENT_ID")); var parentName = AttributeUtil.getFullAttributeName(vars.get("$field.ATTRIBUTE_PARENT_ID"));
name = (parentName ? parentName + " / " : "") + name; name = (parentName ? parentName + " / " : "") + name;
} }
result.string(name); result.string(name);
\ No newline at end of file
...@@ -3,7 +3,7 @@ import("system.vars"); ...@@ -3,7 +3,7 @@ import("system.vars");
import("StandardObject_lib"); import("StandardObject_lib");
// Check if the standard address is already set. // Check if the standard address is already set.
if (vars.get("$field.ADDRESS_ID") === null || vars.get("$field.ADDRESS_ID") === "" || vars.get("$field.ADDRESS_ID") == 0) { if (vars.get("$this.value") === null || vars.get("$this.value") === "" || vars.get("$this.value") == 0) {
var possibleStandardAddressID = new StandardObject("Address", null, "Person", vars.get("$field.CONTACTID")) var possibleStandardAddressID = new StandardObject("Address", null, "Person", vars.get("$field.CONTACTID"))
.onPersonValueChange(vars.get("$field.ORGANISATION_ID")); .onPersonValueChange(vars.get("$field.ORGANISATION_ID"));
......
...@@ -2,8 +2,8 @@ import("system.logging"); ...@@ -2,8 +2,8 @@ import("system.logging");
import("system.vars"); import("system.vars");
import("system.result"); import("system.result");
logging.log("condition -> " + JSON.stringify(vars.get("$field.CONDITION"))); logging.log("condition -> " + JSON.stringify(vars.get("$this.value")));
if(vars.get("$field.CONDITION") == "") if(vars.get("$this.value") == "")
{ {
let entityToScan = vars.get("$param.EntityToFilter_param"); let entityToScan = vars.get("$param.EntityToFilter_param");
logging.log("condition leer neu rein schreiben -> " + entityToScan); logging.log("condition leer neu rein schreiben -> " + entityToScan);
......
import("system.result"); import("system.result");
import("system.vars"); import("system.vars");
if(vars.get("$field.DUPLICATESCAN_ID") == "") if(vars.get("$this.value") == "")
{ {
result.string(vars.get("$param.DuplicateScanId_param")); result.string(vars.get("$param.DuplicateScanId_param"));
} }
\ No newline at end of file
...@@ -3,6 +3,7 @@ import("system.vars"); ...@@ -3,6 +3,7 @@ import("system.vars");
import("system.neon"); import("system.neon");
import("system.db"); import("system.db");
import("system.util"); import("system.util");
import("Sql_lib");
if(vars.exists("$param.OfferHeader_param") && vars.get("$param.OfferHeader_param")) if(vars.exists("$param.OfferHeader_param") && vars.get("$param.OfferHeader_param"))
result.string(vars.get("$param.OfferHeader_param")); result.string(vars.get("$param.OfferHeader_param"));
...@@ -15,6 +16,6 @@ else if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) ...@@ -15,6 +16,6 @@ else if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
if (vars.get("$field.ChoosenTEXHeader") != "") if (vars.get("$field.ChoosenTEXHeader") != "")
{ {
var binaryId = db.cell("select ID from ASYS_BINARIES where ROW_ID = '" + vars.get("$field.ChoosenTEXHeader") + "'", "_____SYSTEMALIAS"); var binaryId = db.cell("select ID from ASYS_BINARIES where ROW_ID = '" + vars.get("$field.ChoosenTEXHeader") + "'", SqlUtils.getSystemAlias());
result.string(util.decodeBase64String(db.getBinaryContent(binaryId, "_____SYSTEMALIAS"))); result.string(util.decodeBase64String(db.getBinaryContent(binaryId, SqlUtils.getSystemAlias())));
} }
\ No newline at end of file
...@@ -8,7 +8,7 @@ var role = ""; ...@@ -8,7 +8,7 @@ var role = "";
if(vars.exists("$param.RoleTitle_param") && (recordstate == neon.OPERATINGSTATE_NEW)) { if(vars.exists("$param.RoleTitle_param") && (recordstate == neon.OPERATINGSTATE_NEW)) {
role = vars.get("$param.RoleTitle_param"); role = vars.get("$param.RoleTitle_param");
} else { } else {
role = vars.get("$field.ROLE"); role = vars.get("$this.value");
} }
result.string(role); result.string(role);
\ No newline at end of file
import("system.result"); import("system.result");
import("system.vars"); import("system.vars");
import("StandardObject_lib"); import("StandardObject_lib");
// Check if the standard address is already set. // Check if the standard address is already set.
if (!vars.get("$field.ADDRESS_ID")) if (!vars.get("$this.value"))
{ {
var possibleStandardAddressID = new StandardObject("Address", null, "Person", vars.get("$field.PERSONID")) var possibleStandardAddressID = new StandardObject("Address", null, "Person", vars.get("$field.PERSONID"))
.onPersonValueChange(vars.get("$field.ORGANISATION_ID")); .onPersonValueChange(vars.get("$field.ORGANISATION_ID"));
// If a possible standard addrss was found it should get applied to the field. // If a possible standard addrss was found it should get applied to the field.
if (possibleStandardAddressID) if (possibleStandardAddressID)
result.string(possibleStandardAddressID); result.string(possibleStandardAddressID);
} }
\ No newline at end of file
...@@ -2,7 +2,7 @@ import("system.vars"); ...@@ -2,7 +2,7 @@ import("system.vars");
import("system.result"); import("system.result");
import("system.neon"); import("system.neon");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$field.QUANTITY")) if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
{ {
result.string("1"); result.string("1");
} }
\ No newline at end of file
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