Skip to content
Snippets Groups Projects
Commit 7b35073b authored by Sebastian Pongratz's avatar Sebastian Pongratz :ping_pong:
Browse files

Merge branch 'sales_1084407_FixTopicTreeMigrateThemes' into '2021.2.0'

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

See merge request xrm/basic!1334
parents c5e2780b 700ed0f0
No related branches found
No related tags found
No related merge requests found
import("Util_lib");
import("system.eMath");
import("TopicTree_lib");
import("system.logging");
......@@ -111,7 +112,7 @@ function _migrateTopicTree(pThemes)
topicObj[themeId]["insertHelper"]["columns"].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;
topicsToLoopTrough.push(themeId);
......@@ -169,8 +170,11 @@ function _migrateTopicTree(pThemes)
previousLayer = TopicTreeUtils.getPreviousLayerName(previousLayer);
if(previousLayer != "SORTING_LAYER_0")
{
topicObj[themeId]["insertHelper"]["columns"].push(previousLayer);
topicObj[themeId]["insertHelper"]["values"].push(-1);//value doesn't matter here
if(!topicObj[themeId]["insertHelper"]["columns"].includes(previousLayer))
{
topicObj[themeId]["insertHelper"]["columns"].push(previousLayer);
topicObj[themeId]["insertHelper"]["values"].push("-1");//value doesn't matter here
}
}
else
{
......@@ -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
var sortingValue = eMath.addInt(i, 1);
topicTreeColumns.push(topicObj[ownTopicId]["layer"]);
topicTreeValues.push(sortingValue);
topicTreeValues[topicTreeColumns.indexOf(topicObj[ownTopicId]["layer"])] = sortingValue;
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