<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Sequencing issues with app.getObject in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Sequencing-issues-with-app-getObject/m-p/1306489#M7274</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Richard,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I encountered the same issue of sequencing in app.getObject.. Would be great if you could provide the solution..Its been a year you reported this issue and I guess you already might have resolved it... &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt; &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/silly.png" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Feb 2018 05:31:19 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-02-20T05:31:19Z</dc:date>
    <item>
      <title>Sequencing issues with app.getObject</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Sequencing-issues-with-app-getObject/m-p/1306488#M7273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having some sequencing issues when working within a mashup and when trying to re-use an object to display a different chart and download the data from that chart.&amp;nbsp; Most of the time it worked fine, but sometimes it returned an error &lt;SPAN style="font-size: 13.3333px;"&gt;VM5616 require.js:44 TypeError: Cannot read property 'then' of undefined.&amp;nbsp; &lt;/SPAN&gt;So, I am now trying to force the getObject call to be synchronous by calling a function&amp;nbsp; setCurrentPriceChart which is not resolved until the app.getObject call has completed.&lt;/P&gt;&lt;P&gt; &lt;SPAN style="color: transparent; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 9pt; white-space: nowrap;"&gt;function setCurrentPriceChart(chartID)&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14988165310305836 jive_text_macro" jivemacro_uid="_14988165310305836" modifiedtitle="true"&gt;
&lt;P&gt;function setCurrentPriceChart(chartID)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; var deferred = $.Deferred();&lt;/P&gt;
&lt;P&gt;&amp;nbsp; currentPriceChart = app.getObject('chartPrice', chartID).then(function()&lt;/P&gt;
&lt;P&gt;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; deferred.resolve();&lt;/P&gt;
&lt;P&gt;&amp;nbsp; });&lt;/P&gt;
&lt;P&gt;&amp;nbsp; return deferred;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a button called cmdPrice which I am using to download the data associated with the chart (see below), but when I write the currentPriceChart object details to the console the value is undefined and an error is returned: VM5616 require.js:44 TypeError: Cannot read property 'then' of undefined at the line var table = new qlik.table(model);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14988167739176292" jivemacro_uid="_14988167739176292"&gt;
&lt;P&gt;$('#cmdPrice').on('click', function() {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; console.log('cmdPrice clicked currentPriceChart=',currentPriceChart);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if(typeof currentPriceChart.value!=="undefined")&lt;/P&gt;
&lt;P&gt;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; //console.log('currentPriceChart.value',currentPriceChart.value);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; currentPriceChart.then(function(model){&lt;/P&gt;
&lt;P&gt;&amp;nbsp; var table = new qlik.table(model);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; return table.exportData({download: true})&lt;/P&gt;
&lt;P&gt;&amp;nbsp; })&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; else&lt;/P&gt;
&lt;P&gt;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; console.log('setCurrentPriceChart strSelectedPageButton=',strSelectedPageButton);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; promise = setCurrentPriceChart(strSelectedPageButton);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; $.when(promise).then(function()&lt;/P&gt;
&lt;P&gt;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; console.log('currentPriceChart=',currentPriceChart);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; currentPriceChart.then(function(model){&lt;/P&gt;
&lt;P&gt;&amp;nbsp; var table = new qlik.table(model);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; return table.exportData({download: true})&lt;/P&gt;
&lt;P&gt;&amp;nbsp; })&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; });&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; });&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2017 10:31:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Sequencing-issues-with-app-getObject/m-p/1306488#M7273</guid>
      <dc:creator>rbartley</dc:creator>
      <dc:date>2017-06-30T10:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Sequencing issues with app.getObject</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Sequencing-issues-with-app-getObject/m-p/1306489#M7274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Richard,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I encountered the same issue of sequencing in app.getObject.. Would be great if you could provide the solution..Its been a year you reported this issue and I guess you already might have resolved it... &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt; &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/silly.png" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Feb 2018 05:31:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Sequencing-issues-with-app-getObject/m-p/1306489#M7274</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-20T05:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: Sequencing issues with app.getObject</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Sequencing-issues-with-app-getObject/m-p/1306490#M7275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kumar ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the end I didn't have enough time to investigate this fully.&amp;nbsp; The following code should work though:&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_15192927169331801" jivemacro_uid="_15192927169331801" modifiedtitle="true"&gt;
&lt;P&gt;app.getObject('chartPriceEvolution','KxYbfG').then( function( vizModel ) {&amp;nbsp; &lt;/P&gt;
&lt;P&gt;$('#cmdPriceAllPeriods').prop('onclick',null).off('click');&lt;/P&gt;
&lt;P&gt;$('#cmdPriceAllPeriods').on('click', function() &lt;/P&gt;
&lt;P&gt;{&amp;nbsp; &lt;/P&gt;
&lt;P&gt;vizModel.exportData().then(function( reply ) {&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;var url = '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://" rel="nofollow" target="_blank"&gt;http://&lt;/A&gt;&lt;SPAN&gt;' + config.host +'/auth'+reply.qUrl;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;window.open(url);&lt;/P&gt;
&lt;P&gt;});&amp;nbsp; &lt;/P&gt;
&lt;P&gt;}); &lt;/P&gt;
&lt;P&gt;});&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2018 09:47:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Sequencing-issues-with-app-getObject/m-p/1306490#M7275</guid>
      <dc:creator>rbartley</dc:creator>
      <dc:date>2018-02-22T09:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: Sequencing issues with app.getObject</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Sequencing-issues-with-app-getObject/m-p/1306491#M7276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kumar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just looked into this again and have a solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_15196472157221876 jive_text_macro" jivemacro_uid="_15196472157221876" modifiedtitle="true"&gt;
&lt;P&gt;function setCurrentPriceChart(chartID)&amp;nbsp; &lt;/P&gt;
&lt;P&gt;{&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; console.log('setCurrentPriceChart ',chartID);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; var deferred = $.Deferred();&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; currentPriceChart = app.getObject('chartPrice', chartID).then(function(vizModel)&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; {&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; deferred.resolve(); &lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; $('#cmdPrice').on('click', function() {&amp;nbsp; &lt;/P&gt;
&lt;P&gt;vizModel.exportData().then(function( reply ) {&amp;nbsp; &lt;/P&gt;
&lt;P&gt;console.log('reply=',reply);&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;var url = '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://" rel="nofollow" target="_blank"&gt;http://&lt;/A&gt;&lt;SPAN&gt;' + config.host +'/auth'+reply.qUrl;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;//console.log('qUrlModified', url); &lt;/P&gt;
&lt;P&gt;window.open(url);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;});&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; }); &lt;/P&gt;
&lt;P&gt;&amp;nbsp; });&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; return deferred;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;} &lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice that the qURL has moved from reply.result.qURL to reply.qURL.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Feb 2018 12:16:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Sequencing-issues-with-app-getObject/m-p/1306491#M7276</guid>
      <dc:creator>rbartley</dc:creator>
      <dc:date>2018-02-26T12:16:43Z</dc:date>
    </item>
  </channel>
</rss>

