<?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: Macro syntax to edit a variable's OnChange properties (trigger) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-syntax-to-edit-a-variable-s-OnChange-properties-trigger/m-p/633307#M232326</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;actionsvar.Item(0).Parameters.Add&lt;/P&gt;&lt;P&gt;actionsvar.Item(0).Parameters.Item(0).v = "Variable"&lt;/P&gt;&lt;P&gt;actionsvar.Item(0).Parameters.Add&lt;/P&gt;&lt;P&gt;actionsvar.Item(0).Parameters.Item(1).v = "Value"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 May 2014 20:15:38 GMT</pubDate>
    <dc:creator>whiteline</dc:creator>
    <dc:date>2014-05-29T20:15:38Z</dc:date>
    <item>
      <title>Macro syntax to edit a variable's OnChange properties (trigger)</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-syntax-to-edit-a-variable-s-OnChange-properties-trigger/m-p/633306#M232325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anyone please provide the correct macro syntax to edit the properties for a variable's OnChange action trigger?&amp;nbsp; I am trying to create the correct macro syntax to disable, and later re-enable a variable's OnChange action under Document Properties.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Problem background&lt;/SPAN&gt;:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;A customer has a macro to automate some actions, and during macro execution, a variable OnChange trigger is being executed between each step, resulting in long macro execution time.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;And yes the customer realizes they should be using built-in actions rather than a macro, but at this point in time, the customer has a macro and it needs to be optimized.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The attached QVW shows a rough approximation of the customer's QVW, with a variable OnChange trigger being executed multiple times over the course of macro execution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far, I was able to modify the macro code to successfully delete the variable's OnChange action on the first step of the script, and later recreate the action at the end of the script.&amp;nbsp; However, when this task gets executed, the OnChange properties for the variable event trigger gets cleared.&amp;nbsp; I've tried looking at the QlikView API Guide for the correct syntax, but I was unable to locate anything to edit the properties for an OnChange action.&amp;nbsp; If anyone could please send along the macro command to modify the properties for an event trigger, it would be much appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sean&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Macro code&lt;/SPAN&gt;:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG style="color: #0070c0; font-size: 12.0pt; font-family: 'Courier New';"&gt;sub&lt;/STRONG&gt; &lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;ClearFields&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0070c0; font-size: 12.0pt; font-family: 'Courier New';"&gt;set&lt;/STRONG&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; v = ActiveDocument.Variables("vBadVariable")&lt;BR /&gt; prop = v.GetProperties&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: #77933c;"&gt;' msgbox prop.OnChangeActionItems.Item(0).type&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0070c0; font-size: 12.0pt; font-family: 'Courier New';"&gt;set&lt;/STRONG&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; actionsvar=prop.OnChangeActionItems&lt;BR /&gt; actionsvar.RemoveAt(0)&lt;BR /&gt; &lt;BR /&gt; v.SetProperties prop&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; ActiveDocument.Fields("Dim2").Clear&lt;BR /&gt; ActiveDocument.Fields("Dim3").Clear &lt;BR /&gt; ActiveDocument.Fields("Expression1").Clear&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; actionsvar.Add&lt;BR /&gt; actionsvar.Item(0).Type = 31&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: #77933c;"&gt;' Missing: How to edit the OnChange properties for the variable event trigger&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;BR /&gt; v.SetProperties prop&lt;BR /&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0070c0; font-size: 12.0pt; font-family: 'Courier New';"&gt;end&lt;/STRONG&gt; &lt;STRONG style="color: #0070c0; font-size: 12.0pt; font-family: 'Courier New';"&gt;sub&lt;/STRONG&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 19:17:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-syntax-to-edit-a-variable-s-OnChange-properties-trigger/m-p/633306#M232325</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-29T19:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Macro syntax to edit a variable's OnChange properties (trigger)</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-syntax-to-edit-a-variable-s-OnChange-properties-trigger/m-p/633307#M232326</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;actionsvar.Item(0).Parameters.Add&lt;/P&gt;&lt;P&gt;actionsvar.Item(0).Parameters.Item(0).v = "Variable"&lt;/P&gt;&lt;P&gt;actionsvar.Item(0).Parameters.Add&lt;/P&gt;&lt;P&gt;actionsvar.Item(0).Parameters.Item(1).v = "Value"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 20:15:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-syntax-to-edit-a-variable-s-OnChange-properties-trigger/m-p/633307#M232326</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2014-05-29T20:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: Macro syntax to edit a variable's OnChange properties (trigger)</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-syntax-to-edit-a-variable-s-OnChange-properties-trigger/m-p/633308#M232327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect!&amp;nbsp; Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 20:18:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-syntax-to-edit-a-variable-s-OnChange-properties-trigger/m-p/633308#M232327</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-29T20:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: Macro syntax to edit a variable's OnChange properties (trigger)</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-syntax-to-edit-a-variable-s-OnChange-properties-trigger/m-p/633309#M232328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is wonderful.&lt;/P&gt;&lt;P&gt;How would I modify it to specify an Alternate State?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 15:58:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-syntax-to-edit-a-variable-s-OnChange-properties-trigger/m-p/633309#M232328</guid>
      <dc:creator />
      <dc:date>2014-07-17T15:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Macro syntax to edit a variable's OnChange properties (trigger)</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-syntax-to-edit-a-variable-s-OnChange-properties-trigger/m-p/633310#M232329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Charissa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try adding the name of the Alternate State with double quotes as a second parameter in the macro code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Example&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sub&lt;/STRONG&gt; ClearFields&lt;/P&gt;&lt;P&gt;&amp;nbsp; ActiveDocument.Fields("Dim2","&lt;STRONG&gt;AltState1&lt;/STRONG&gt;").Clear&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;end&lt;/STRONG&gt; sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2014 19:56:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-syntax-to-edit-a-variable-s-OnChange-properties-trigger/m-p/633310#M232329</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-29T19:56:33Z</dc:date>
    </item>
  </channel>
</rss>

