<?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 Sheet OnActivate trigger: problem with macro + select in field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sheet-OnActivate-trigger-problem-with-macro-select-in-field/m-p/325022#M119729</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; What happens if you move the line toward the top?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Feb 2012 14:15:32 GMT</pubDate>
    <dc:creator>Bill_Britt</dc:creator>
    <dc:date>2012-02-28T14:15:32Z</dc:date>
    <item>
      <title>Sheet OnActivate trigger: problem with macro + select in field</title>
      <link>https://community.qlik.com/t5/QlikView/Sheet-OnActivate-trigger-problem-with-macro-select-in-field/m-p/325021#M119728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm experiencing a problem with the OnActivate trigger on a sheet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want to do is:&lt;/P&gt;&lt;P&gt;1. "select in field" action&lt;/P&gt;&lt;P&gt;2. run a macro which clears some fields (one of them being "﻿StartDate_Year")&lt;/P&gt;&lt;P&gt;﻿3. run another macro (clears some other fields)&lt;/P&gt;&lt;P&gt;4. "select in field" action --&amp;gt; sets a value in field "StartDate_Year"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, when I switch to the sheet, action #4 is not executed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I replace actions #2 and #3 by a sequence of "Clear field" actions, everything works just fine, so the problem is not in action #4.&lt;/P&gt;&lt;P&gt;The reason I want to use a macro, is so I can reuse this over multiple sheets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Content of the macro is very simple:&lt;/P&gt;&lt;P&gt;Function ClearFields_StartDate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.Fields("StartDate_YearMonth").Clear&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.Fields("StartDate_Dt").Clear&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.Fields("StartDate_Day").Clear&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.Fields("StartDate_Month").Clear&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.Fields("StartDate_MonthShort_NL").Clear&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.Fields("StartDate_MonthShort_FR").Clear&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.Fields("StartDate_MonthName_NL").Clear&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.Fields("StartDate_MonthName_FR").Clear&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.Fields("StartDate_YearMonth_NL").Clear&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.Fields("StartDate_YearMonth_FR").Clear&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.Fields("StartDate_Year").Clear&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;End Function&lt;/P&gt;&lt;P&gt;(second macro is identical - with end dates)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I comment out the last line (clearing the "StartDate_Year" field), everything also works like a charm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I'm having the idea that Qlikview is not executing the trigger actions in the correct order?&lt;/P&gt;&lt;P&gt;Has someone else experienced this problem?&lt;/P&gt;&lt;P&gt;I am running QV10 SR1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Nico&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 13:45:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sheet-OnActivate-trigger-problem-with-macro-select-in-field/m-p/325021#M119728</guid>
      <dc:creator />
      <dc:date>2012-02-28T13:45:05Z</dc:date>
    </item>
    <item>
      <title>Sheet OnActivate trigger: problem with macro + select in field</title>
      <link>https://community.qlik.com/t5/QlikView/Sheet-OnActivate-trigger-problem-with-macro-select-in-field/m-p/325022#M119729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; What happens if you move the line toward the top?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 14:15:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sheet-OnActivate-trigger-problem-with-macro-select-in-field/m-p/325022#M119729</guid>
      <dc:creator>Bill_Britt</dc:creator>
      <dc:date>2012-02-28T14:15:32Z</dc:date>
    </item>
  </channel>
</rss>

