Skip to content
Snippets Groups Projects
Commit 3c5da06e authored by Pascal Neub's avatar Pascal Neub
Browse files

[Projekt: xRM-Sales][TicketNr.: 2001145][Salesproject: Attributes: Team:...

[Projekt: xRM-Sales][TicketNr.: 2001145][Salesproject: Attributes: Team: AditoIllegalStateException]
parent 19fba8d5
No related branches found
No related tags found
No related merge requests found
......@@ -3,33 +3,42 @@ import("system.vars");
import("system.teams");
import("system.entities");
import("system.db");
import("Sql_lib");
import("Util_lib");
import("Sql_lib");
import("MSTeams_lib");
var data = newSelect([
"MST_TEAM.MST_TEAMID",
"MST_TEAM.TEAMNAME",
"MST_TEAM.IS_ARCHIVED"
]).from("MST_TEAM").table();
var idvalues = vars.get("$local.idvalues");
if(idvalues)
if(MSTeamsUtils.isTeamsEnabled())
{
var iddata = data.filter(function(entry){return idvalues.includes(entry[0])});
if(iddata.length < idvalues.length)
var data = newSelect([
"MST_TEAM.MST_TEAMID",
"MST_TEAM.TEAMNAME",
"MST_TEAM.IS_ARCHIVED"
]).from("MST_TEAM").table();
var idvalues = vars.get("$local.idvalues");
if(idvalues)
{
var iddata = data.filter(function(entry){return idvalues.includes(entry[0])});
if(iddata.length < idvalues.length)
{
iddata = _apiData().filter(function(entry){return idvalues.includes(entry[0])});
}
result.object(iddata);
}
else
{
iddata = _apiData().filter(function(entry){return idvalues.includes(entry[0])});
var apiData = _apiData();
if(!vars.get("$param.IncludeArchived_param"))
{
apiData = apiData.filter(function(entry){return !Utils.toBoolean(entry[2])});
}
result.object(apiData);
}
result.object(iddata);
}
else
{
var apiData = _apiData();
if(!vars.get("$param.IncludeArchived_param"))
{
apiData = apiData.filter(function(entry){return !Utils.toBoolean(entry[2])});
}
result.object(apiData);
// return nothing if teams is disabled
result.object([]);
}
/**
......
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