1 Reply Latest reply: Oct 15, 2018 5:02 AM by Øystein Kolsrud RSS

    getLayout() return '-' values when called after createSessionVariable()

    Ben Decruz

      Using enigma, I try creating session variables before creating session object and getLayout.

       

      1. handle:1
      2. id:2
      3. jsonrpc:"2.0"
      4. method:"CreateSessionVariable"
      5. params:Array(1)
        1. 0:
          1. qDefinition:"GetFieldSelections(Date)"
          2. qInfo:{qType: "variable"}
          3. qName:"varDate"

      This returns a GenericVariable.  Then I create session object


      1. handle:1
      2. id:4
      3. jsonrpc:"2.0"
      4. method:"CreateSessionObject"
      5. params:Array(1)
        1. 0:
          1. qHyperCubeDef:
            1. qDimensions:[]
            2. qInitialDataFetch:Array(1)
              1. 0:{qHeight: 1, qWidth: 1}
            1. qMeasures:Array(3)
              1. 0:
                1. qDef:{qDef: "sum({<Date={'$(varDate)'}, CLASS={'Extra'}>}TEST%)"}


      This returns a GenericObject.  Then I tried checking if the session variables are created using GetVariableByName and GetProperties.  I won't display it here but I am able to see that the variable with the definition was indeed existing.  Then I call on getLayout() and got this in qMatrix


      1. qMatrix:Array(1)
        1. 0:Array(3)
          1. 0:{qText: "-", qNum: "NaN", qElemNumber: 0, qState: "L", qIsNull: true}


      In short, I am not getting the value.  Next thing I did is to remove the creation of session variable in the code and run the app again.  This time, the GetVariableByName returns "Object not found".  But the getLayout() returned me the value.


      1. qMatrix:Array(1)
        1. 0:Array(3)
          1. 0:{qText: "0.345", qNum: 0, qElemNumber: 0, qState: "L"}


      I would appreciate if you can explaiin me what's happening.