Skip to content
Snippets Groups Projects
Commit 700ed0f0 authored by Benjamin Ulrich's avatar Benjamin Ulrich :speech_balloon: Committed by Sebastian Pongratz
Browse files

[Projekt: xRM-Sales][TicketNr.: 1084407][Themenbaum - Prozess zum migrieren von Altdaten]

parent 0ce9bf2d
No related branches found
No related tags found
No related merge requests found
import("Util_lib");
import("system.eMath"); import("system.eMath");
import("TopicTree_lib"); import("TopicTree_lib");
import("system.logging"); import("system.logging");
...@@ -111,7 +112,7 @@ function _migrateTopicTree(pThemes) ...@@ -111,7 +112,7 @@ function _migrateTopicTree(pThemes)
topicObj[themeId]["insertHelper"]["columns"].push("DATE_NEW"); topicObj[themeId]["insertHelper"]["columns"].push("DATE_NEW");
topicObj[themeId]["insertHelper"]["values"].push(date_new); topicObj[themeId]["insertHelper"]["values"].push(date_new);
if(theme_id && Utils.isNotNullOrEmpty(theme_id)) if(theme_id && Utils.isNotNullOrEmptyString(theme_id))
{ {
topicObj[themeId]["assignedTo"] = theme_id; topicObj[themeId]["assignedTo"] = theme_id;
topicsToLoopTrough.push(themeId); topicsToLoopTrough.push(themeId);
...@@ -169,8 +170,11 @@ function _migrateTopicTree(pThemes) ...@@ -169,8 +170,11 @@ function _migrateTopicTree(pThemes)
previousLayer = TopicTreeUtils.getPreviousLayerName(previousLayer); previousLayer = TopicTreeUtils.getPreviousLayerName(previousLayer);
if(previousLayer != "SORTING_LAYER_0") if(previousLayer != "SORTING_LAYER_0")
{ {
topicObj[themeId]["insertHelper"]["columns"].push(previousLayer); if(!topicObj[themeId]["insertHelper"]["columns"].includes(previousLayer))
topicObj[themeId]["insertHelper"]["values"].push(-1);//value doesn't matter here {
topicObj[themeId]["insertHelper"]["columns"].push(previousLayer);
topicObj[themeId]["insertHelper"]["values"].push("-1");//value doesn't matter here
}
} }
else else
{ {
...@@ -210,8 +214,7 @@ function _migrateTopicTree(pThemes) ...@@ -210,8 +214,7 @@ function _migrateTopicTree(pThemes)
//we don't change the original order tho, since we used the stored sortingValue to sort said array that we are now looping trough //we don't change the original order tho, since we used the stored sortingValue to sort said array that we are now looping trough
var sortingValue = eMath.addInt(i, 1); var sortingValue = eMath.addInt(i, 1);
topicTreeColumns.push(topicObj[ownTopicId]["layer"]); topicTreeValues[topicTreeColumns.indexOf(topicObj[ownTopicId]["layer"])] = sortingValue;
topicTreeValues.push(sortingValue);
statements.push(["TOPICTREE", topicTreeColumns, null, topicTreeValues]); statements.push(["TOPICTREE", topicTreeColumns, null, topicTreeValues]);
} }
} }
......
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