Skip to content
Snippets Groups Projects
Commit 3abcd8da authored by Johannes Goderbauer's avatar Johannes Goderbauer
Browse files

Organisation: aroundLocation was calculated in new/edit mode

parent 3dc4842b
No related branches found
No related tags found
No related merge requests found
......@@ -3,21 +3,24 @@ import("system.neon");
import("system.vars");
import("system.entities");
//use read entity since the lat and lon fields are not loaded by default since they are not needed otherwise
var rowConfig = entities.createConfigForLoadingRows()
.fields(["STANDARD_LAT", "STANDARD_LON"])
.entity(vars.get("$sys.currententityname"))
.uid(vars.get("$sys.uid"));
var row = entities.getRow(rowConfig);
var recordState = vars.get("$sys.operatingstate");
var res = neon.COMPONENTSTATE_DISABLED;
var uid = vars.get("$sys.uid");
if (recordState != neon.OPERATINGSTATE_NEW && recordState != neon.OPERATINGSTATE_EDIT && uid)
{
//use read entity since the lat and lon fields are not loaded by default since they are not needed otherwise
var rowConfig = entities.createConfigForLoadingRows()
.fields(["STANDARD_LAT", "STANDARD_LON"])
.entity(vars.get("$sys.currententityname"))
.uid(uid);
var row = entities.getRow(rowConfig);
var lat = row["STANDARD_LAT"];
var lon = row["STANDARD_LON"];
var lat = row["STANDARD_LAT"];
var lon = row["STANDARD_LON"];
if (lat && lon)
res = neon.COMPONENTSTATE_AUTO;
}
var res;
if (lat && lon)
res = neon.COMPONENTSTATE_AUTO;
else
res = neon.COMPONENTSTATE_DISABLED;
result.string(res);
\ 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