6 Replies Latest reply: Nov 2, 2017 4:38 AM by Swapnil Kumbhar RSS

    Qsock deleteConnection method : Not able to delete Qlik sense Desktop connection

    Swapnil Kumbhar

      Hi All,

       

      I want delete data connection of app in Qlik sense Desktop. I am using qsock object for that. I have written following code to delete Data connection but no luck. Not getting any error but Data connection is also not deleted. i am missing something in passing parameters in deleteConnection method.

       

      Code :

       

      const qsocks = require('qsocks');

      const connectionName = 'Test';

       

       

      qsocks.Connect( {appname: connectionName } )

      .then( global => {

       

          // Access to the global class

          // http://help.qlik.com/en-US/sense-developer/2.2/Subsystems/EngineAPI/Content/Classes/GlobalClass/Global-class.htm

       

          return global.openDoc( connectionName )

                .then( app => {

                     console.log('Deleting')

                     return app.deleteConnection('1e9290c4-eb65-4b05-bce9-e21bdbb88dc1').then(function(reply) {

                     console.log('Deleted: ' +reply)

                })

           })

           .then(() => {

                   // Close our connection.

                   return global.connection.close();

               })

               .catch( err => {

                   console.log( err )

               })

      })

      .then(() => {

          console.log('Done!')

      })

       

      Please Help.

       

      Thanks & Regards,

      Swapnil