Hi,
I am trying to assign a hierarchy level filter based on a tenant id in a loading script, so that as soon as some one from that tenant enters they are drilled down to the respected hierarchy level. But, I am still not sure where this is going wrong. Can someone help me figure this out ?
// get current tenantId
var tenID = window.dundas.context.currentSession.tenantId;
if(tenID == '56004983-c099-47eb-b821-0378cddbd769') {
// set the hierarchy level parameter, see below
// Get the parent view.
var parentView = this.parentView;
// Get the view parameters.
var viewParameter =
parentView.control.viewParameters;
// Using the library, get the view parameter based on it's name
var viewParameter =
this.parentView.control.getViewParameterByName("viewParameter1");
//viewParameter.parameterValue.clearTokens();
//viewParameter.parameterValue.clearValues();
if(hierarchyLevelList.value == "executive_area")
{
// Set the details level to the product category level, the top level.
viewParameter.parameterValue.detailsLevelDepth = 0;
}
else if(hierarchyLevelList.value == "area")
{
// Set the details level to the product sub category level, the second level.
viewParameter.parameterValue.detailsLevelDepth = 1;
}
else if(hierarchyLevelList.value == "region")
{
// Set the details level to the product level, the thrid level.
viewParameter.parameterValue.detailsLevelDepth = 2;
}
else if(hierarchyLevelList.value == "location_name")
{
// Set the details level to the product level, the fourth level.
viewParameter.parameterValue.detailsLevelDepth = 3;
}
// Set the top level depth to show details level depth.
viewParameter.parameterValue.topLevelDepth = 2;
// Sets the value of lastModifiedTime to now
viewParameter.invalidateLastModifiedTime();
// Update all the connected adapters with the newly modified values
// Includes data visualizations and filter controls
viewParameter.refreshAllAdapters();
}