Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
mgranillo
Specialist
Specialist

No response from OpenDoc method on desktop

Can someone tell me what's wrong with my code?

I'm trying to communicate with the desktop engine using the opendoc method and the browser. 

The getdoclist method works so i have a working connection.  I just don't know why i dont get a result for the OpenDoc method.

<!doctype html>

<!-- <html> -->

<html>

<head>

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

<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.js"></script>

<script>

function connect() {

  qsocks.Connect().then(global => {

  global.getDocList().then(function(documents) {

          var available_docs = [];

          documents.forEach(function(document_entry){

            available_docs.push(document_entry.qDocId);

          });

   console.log(available_docs);

   });

  

     global.OpenDoc("H:\My Documents\Qlik\Sense\Apps\Consumer_Sales.qvf").then(function(app) {

  app.GetAllInfos().then(function(appInfos){

              var measures_list = [];

              appInfos.qInfos.forEach(function(document_infos){

                if(document_infos.qType=='measures'){

                  measures_list.push(document_infos.qId) 

                }

              });

   console.log(measures_list.length());

  });

  });

   });

}

connect();

</script>

<body></body>

</script>

</head>

<body>

</body></html>

11 Replies
Anonymous
Not applicable

Has this problem been resolved? I cannot open a local app with openDoc().

Alexander_Thor
Employee
Employee

qsocks has been deprecated for quite a while now. I would recommend you check out https://github.com/qlik-oss/enigma.js which is a much better alternative.