tm1Ui.DimensionElements function returning undefined for some users


#1

We have an issue where on some users machines using Chrome the tm1Ui.DimensionElements() is returning undefined. It works correctly in IE though. It seems to be happening on windows machines with Chrome, Macs using Chrome look like they are OK.

When looking in Chrome debugger, it looks like it is trying to make a GET call instead of a POST and returning a 400 error.

Here is the code we see it happening with.

$tm1Ui.dimensionElements($scope.page.serverName, "Period", "Last,FiscalYear", "Forecast Current By Month", "", "", "", false, false)
    .then(function(periodData){  
      return Promise.all([periodData, 
        $tm1Ui.dimensionElements($scope.page.serverName, "Period", "", "", "{[Period].[" + periodData[0].Attributes.FiscalYear + "].Children}", "", "", false, false),
        $tm1Ui.dimensionElements($scope.page.serverName, "Period", "","", "{LastPeriods(12,[Period].["+ periodData[0].Attributes.Last + "])}", "", "", false, false)
        ]);
    })
    .then(function(periodYearData)
    {
      $scope.page.Periods = periodYearData[0];
      $scope.yearDetails.FirstQtrName = $scope.page.Periods[0].Parents[0].Name;
      $scope.yearDetails.SecondQtrName = $scope.page.Periods[3].Parents[0].Name;
      $scope.yearDetails.ThirdQtrName = $scope.page.Periods[7].Parents[0].Name;
      $scope.yearDetails.FourthQtrName = $scope.page.Periods[10].Parents[0].Name;
      if($scope.yearDetails.FirstQtrName.substring(1,2) == "Q1")
      {
        $scope.yearDetails.PriorFirstQtrVersion = "Forecast Working";     
      }
      if($scope.yearDetails.FirstQtrName.substring(1,2) == "Q1" || $scope.yearDetails.FirstQtrName.substring(1,2) == "Q2")
      {
        $scope.yearDetails.PriorSecondQtrVersion = "Forecast Working";     
      }
      if($scope.yearDetails.FirstQtrName.substring(1,2) == "Q4")
      {
        $scope.yearDetails.PriorThirdQtrVersion = "Forecast Working";     
      }
      $scope.yearDetails.PriorYearName = $scope.page.Periods[0].Attributes.FiscalYear;
      $scope.yearDetails.PriorMonthNames = periodYearData[2];
      $scope.yearDetails.PriorYearNames[0] = periodYearData[1][0].Name;
      $scope.yearDetails.PriorYearNames[1] = periodYearData[1][1].Name;
      $scope.yearDetails.PriorYearNames[2] = periodYearData[1][2].Name;
      $scope.yearDetails.PriorYearNames[3] = periodYearData[1][3].Name;
      $scope.yearDetails.PriorYearNames[4] = $scope.yearDetails.PriorYearName;
      $scope.yearDetails.PriorFirstQtrName = periodYearData[1][0].Name;
      $scope.yearDetails.PriorSecondQtrName = periodYearData[1][1].Name;
      $scope.yearDetails.PriorThirdQtrName = periodYearData[1][2].Name;
      $scope.yearDetails.PriorFourthQtrName = periodYearData[1][3].Name;
    })
    .catch(function(err){
      console.log(err);
    });

#2

Hi @chet_watkins,

Which of the requests fired a GET request? Can you check the details?

Next, if you fire it without using Promise.all, does it work?

Also, by returning undefined, is it for the 3 requests?


Paul


#3

I had the problem before adding the promise.all. I added the promise.all after doing some reasearch on serializing promises and best practices on trying to run code off of results obtained.

I can get the get request specifics tomorrow for you. I have a Mac and can’t recreate the issue on my machine.

It’s the first request. The second request needs the first ones data.


#4

Is there an email I can send the screenshots we took to? I would prefer not posting them in a public forum.

Thanks,
Chet


#5

Hi @chet_watkins,

Check also the application.logs file and see what is the actual error.


Paul