1 Reply Latest reply: Nov 27, 2015 10:13 AM by Anders Uddenberg RSS

    Is GetTablesAndKeys() broken?

    Anders Uddenberg

      I want to use the method GetTablesAndKeys and I'm doing this in my extension

       

      var app = qlik.currApp(this);
      if (typeof app.getTablesAndKeys === "function") { 
         app.getTablesAndKeys(qWindowSize, qNullSize, 0, false, false).then(function(data) {
           console.log(data);
         });
        } else {
         console.log("GetTablesAndKeys not available on app");
        }
      

       

      What I get is the error "GetTablesAndKeys not available on app" but it should be afaik.

       

      Any idea what I'm doing wrong?

        • Re: Is GetTablesAndKeys() broken?
          Anders Uddenberg

          Solved it but I'll leave a reply for anyone interested in this.

           

          Turns out I tried to call getTablesAndKeys on "app" that I got from qlik.currApp(this).

           

          What I had to do in my extension is to include engine, as such:

           

          define( ["qlik", "jquery", "text!./style.css","core.models/engine"], function (qlik, $, cssContent, engine) {
          

           

          Please note "core.models/engine" and then function(.... engine) {

           

          Then I can do

           

          var app = engine.currentApp;
          app.getTablesAndKeys(...)
          

           

           

          Turns out it's important to know which API is used where. Go figure