Skip to content
Snippets Groups Projects
Commit 96023dc2 authored by Andre Loreth's avatar Andre Loreth Committed by Sebastian Listl
Browse files

[Projekt: Entwicklung - Neon][TicketNr.: 1081390][Firmenlookup öffnet sich +...

[Projekt: Entwicklung - Neon][TicketNr.: 1081390][Firmenlookup öffnet sich + Fehlermeldung in Endlosschleife] Check existence of variables before accessing them

There are certain cases where *.insertedRows/*.changedRows/*.deletedRows variables are NOT available. Therefore an existence check is necessary before accessing them.
One specific case is the following: The "valueProcess" of a parameter in a consumer needs to access any of the above listed variables of another consumer field. This basically works just fine. BUT as soon as you're in a Lookup, the consumer might not be available, therefore the existence check is necessary to prevent an exception.
parent 21a44241
No related branches found
No related tags found
No related merge requests found
......@@ -504,10 +504,28 @@ EntityConsumerRowsHelper.prototype.fetchRowsFromConsumer = function (pFields)
*/
EntityConsumerRowsHelper.prototype.applyConsumerRowChanges = function ()
{
var insertedRows = vars.get("$field." + this._consumer + ".insertedRows");
var changedRows = vars.get("$field." + this._consumer + ".changedRows");
var deletedRows = vars.get("$field." + this._consumer + ".deletedRows");
var insertedRows = null;
var changedRows = null;
var deletedRows = null;
// As soon as you're in a Lookup, the consumer might not be available.
// Therefore, the existence check for each variable is necessary to prevent an exception.
if (vars.exists("$field." + this._consumer + ".insertedRows"))
{
insertedRows = vars.get("$field." + this._consumer + ".insertedRows")
}
if (vars.exists("$field." + this._consumer + ".changedRows"))
{
changedRows = vars.get("$field." + this._consumer + ".changedRows")
}
if (vars.exists("$field." + this._consumer + ".deletedRows"))
{
deletedRows = vars.get("$field." + this._consumer + ".deletedRows")
}
if (deletedRows && deletedRows.length > 0)
this.removeRows(deletedRows);
if (changedRows && changedRows.length > 0)
......
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