0 Replies Latest reply: Oct 10, 2016 4:27 AM by Karthik Srinivasan RSS

    How to setproperties of a master dimension (engine API, qsocks)

    Karthik Srinivasan

      Hi,

      I want to use qsocks to update an existing master dimension. I'm unable to make the change. Can you please let me know what is wrong here?

       

      These are the steps I followed:

      1. Launch QS Desktop

      2. Create a new app called 'QlikCommunityTest.qvf'

      3. Use ctrl+00 to load the demo script

      4. Create a new master dimension with the field 'Dim1' and id as ' mydimid1' using the "dimension.js" in the qsocks examples folder.

      5. Now, I'd like to update this master dimension to read from 'Dim3'. To achieve this I run this HTML in the browser

      "

      <html>

      <head>

          <script src="https://rawgit.com/mindspank/qsocks/master/qsocks.bundle.js"></script>

          <script>

       

          const applicationName = 'QlikCommunityTest.qvf';

          const var_dimid = 'mydimid1';

       

          qsocks.Connect().then(function(global) {

              global.openDoc(applicationName).then(function(app) {

                  app.getDimension(var_dimid).then(function(dim1) {

                      dim1.setProperties({

                  qInfo: {

                      qId: 'mydimid1',

                      qType: 'dimension'

                      },

                  qDim: {

                      qGrouping: 'N',

                      qFieldDefs: 'Dim3',

                      qFieldLabels: 'DimMastertempnew',

                      title: 'mydimid1'

                      },

                  qMetaDef: {

                      title: 'mydimid1'

                      }

                  })

              })

          })

      })

       

      </script>

      </head>

          <body></body>

      </html>

      ".

       

      I do not see any change to my master dimension.