<?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 Manipulate Load script Variable in Extension in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Manipulate-Load-script-Variable-in-Extension/m-p/6910#M608581</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to manipulate load script inside my extension. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, I would like to have a variable with customer Id, that would be calculated inside my extension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For testing (just to see how this behave) I try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In LOAD script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM style=": ; color: #0000ff;"&gt;Set MyVar = 4;&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM style=": ; color: #0000ff;"&gt;Exit Script when MyVar&amp;lt;&amp;gt;4;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inside my extension:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;app.variable.setNumValue("&lt;SPAN style="font-size: 13.3333px;"&gt;MyVar&lt;/SPAN&gt;", 5);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;app.doReload(2,false,false).then(function(e) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.doSave();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;});&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;This gave me an Internal engine error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;And even if it would work, I can see the problem, that after doReload is called the MyVar is set to 4 again. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;So my second &lt;/SPAN&gt;approach&lt;SPAN style="font-size: 10pt;"&gt; was &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;If Len(Trim('$(vScriptVariable1)')) = 0 then&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;Set MyVar = 4;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;Else&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;Set MyVar = 3;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;End If&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;Exit Script when MyVar&amp;lt;&amp;gt;4;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and inside my extension:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;app.variable.create({qName : 'vScriptVariable1'});&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;app.variable.setStringValue("vScriptVariable1","marko");&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;app.doReload(2,false,false).then(function(e) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.doSave();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;});&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it give me the same error. &lt;/P&gt;&lt;P&gt;If I change &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 13.3333px;"&gt;app.variable.setStringValue("vScriptVariable1","marko");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 13.3333px;"&gt;to &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 13.3333px;"&gt;app.variable.setStringValue(vScriptVariable1,"marko");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 13.3333px;"&gt;error goes away, but nothing happened. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 13.3333px;"&gt;How to do this right?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 13.3333px;"&gt;&lt;SPAN style="color: #000000;"&gt;Marko Zadravec&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Jan 2018 08:30:16 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-01-25T08:30:16Z</dc:date>
    <item>
      <title>Manipulate Load script Variable in Extension</title>
      <link>https://community.qlik.com/t5/QlikView/Manipulate-Load-script-Variable-in-Extension/m-p/6910#M608581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to manipulate load script inside my extension. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, I would like to have a variable with customer Id, that would be calculated inside my extension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For testing (just to see how this behave) I try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In LOAD script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM style=": ; color: #0000ff;"&gt;Set MyVar = 4;&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM style=": ; color: #0000ff;"&gt;Exit Script when MyVar&amp;lt;&amp;gt;4;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inside my extension:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;app.variable.setNumValue("&lt;SPAN style="font-size: 13.3333px;"&gt;MyVar&lt;/SPAN&gt;", 5);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;app.doReload(2,false,false).then(function(e) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.doSave();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;});&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;This gave me an Internal engine error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;And even if it would work, I can see the problem, that after doReload is called the MyVar is set to 4 again. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;So my second &lt;/SPAN&gt;approach&lt;SPAN style="font-size: 10pt;"&gt; was &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;If Len(Trim('$(vScriptVariable1)')) = 0 then&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;Set MyVar = 4;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;Else&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;Set MyVar = 3;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;End If&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;Exit Script when MyVar&amp;lt;&amp;gt;4;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and inside my extension:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;app.variable.create({qName : 'vScriptVariable1'});&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;app.variable.setStringValue("vScriptVariable1","marko");&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;app.doReload(2,false,false).then(function(e) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.doSave();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;});&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it give me the same error. &lt;/P&gt;&lt;P&gt;If I change &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 13.3333px;"&gt;app.variable.setStringValue("vScriptVariable1","marko");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 13.3333px;"&gt;to &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 13.3333px;"&gt;app.variable.setStringValue(vScriptVariable1,"marko");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 13.3333px;"&gt;error goes away, but nothing happened. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 13.3333px;"&gt;How to do this right?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 13.3333px;"&gt;&lt;SPAN style="color: #000000;"&gt;Marko Zadravec&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jan 2018 08:30:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Manipulate-Load-script-Variable-in-Extension/m-p/6910#M608581</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-25T08:30:16Z</dc:date>
    </item>
  </channel>
</rss>

