<?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: Module Code Argument Errors in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Module-Code-Argument-Errors/m-p/1019545#M345088</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I never could get the log.txt file to have any content&lt;/P&gt;&lt;P&gt;After adding a bunch of msgbox statements to track the flow i was able to get it working simply by commenting out the &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;ActiveDocument.ClearAll statement&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;The Production version is working fine with the &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;ActiveDocument.ClearAll statement not commented out&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Mar 2016 17:10:24 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-03-18T17:10:24Z</dc:date>
    <item>
      <title>Module Code Argument Errors</title>
      <link>https://community.qlik.com/t5/QlikView/Module-Code-Argument-Errors/m-p/1019542#M345085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have inherited an application and am now trying to update it as the source system is migrating from an Oracle DB to a SQL DB.&lt;/P&gt;&lt;P&gt;There is some Module code that is used to control the sheet display&lt;/P&gt;&lt;P&gt;Basically dependent on the users filter selection either Tables/Charts A, B, C or D, E, F are displayed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code seems pretty straightforward however the version of the application that is pointing at SQL has simply stopped working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been searching the community and the API Guide to try and find ways around this with no luck.&lt;/P&gt;&lt;P&gt;We are running QlikView 10 &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is as follows,I trimmed out the rest of the If statement for space&lt;/P&gt;&lt;P&gt;It runs as far as the code line that is in Bold and then gives an "Invalid procedure call or argument" error&lt;/P&gt;&lt;P&gt;I have been trying to verify the content of the 'values' variable using msgbox without any luck&lt;/P&gt;&lt;P&gt;It is almost as if the selection made on ReportContext is triggering the module but then getting lost somewhere&lt;/P&gt;&lt;P&gt;We have other much more complex applications that have been updated for the migration with only PL SQL related changes needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Even with setting a different value and using a For loop with conditions basedon Numeric or Text content i am not able to get the to the true content of 'values'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub OnSelectReportContext&lt;/P&gt;&lt;P&gt;&amp;nbsp; ActiveDocument.ClearAll&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; .... Chart Variable definitions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set reportContext = ActiveDocument.Fields("ReportContext")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set values = reportContext.GetSelectedValues&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If values.Item(i).Text = "Creation Date" Then&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'Creation Pivot/Line - Display/Maximize&lt;/P&gt;&lt;P&gt;... Chart display definitions - restore/top layer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case it helps here is the script code where ReportContext is set.&lt;/P&gt;&lt;P&gt;DetailCreationDate:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp; DTL_ObjID, // key&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'Creation Date' As ReportContext // key&lt;/P&gt;&lt;P&gt;Resident Detail;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DetailCompletionDate:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp; DTL_ObjID, // key&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'Completion Date' As ReportContext // key&lt;/P&gt;&lt;P&gt;Resident Detail Where (DTL_LifeCycleState = 'IMPLEMENTATION' AND DTL_ObjState = 'COMPLETED') OR DTL_ObjState = 'CANCELLED';&lt;/P&gt;&lt;P&gt;-- This ignores teh DetailCompletionDate table label as the columns are the same in DetailCreationDate&lt;/P&gt;&lt;P&gt;I have verified that there are records in the table for both Completion Date and Creation Date&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Mar 2016 20:17:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Module-Code-Argument-Errors/m-p/1019542#M345085</guid>
      <dc:creator />
      <dc:date>2016-03-17T20:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Module Code Argument Errors</title>
      <link>https://community.qlik.com/t5/QlikView/Module-Code-Argument-Errors/m-p/1019543#M345086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to check this field with a routine like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub LogFunktion&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 'This routine logs selection to a text file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set fso = CreateObject("Scripting.FileSystemObject")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set mypath = ActiveDocument.GetProperties&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; directory = mypath.MyWorkingDirectory &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; On Error Resume Next&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ' See if file already exists.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Set filFile = fso.GetFile(directory &amp;amp; "log.txt")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ' If not, then create it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; If Err &amp;lt;&amp;gt; 0 Then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set filFile = fso.CreateTextFile(directory &amp;amp; "log.txt")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; End If&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Set txsStream = filFile.OpenAsTextStream(8) 'For Appending&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set doc = ActiveDocument&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set mySelections = doc.fields("Field").GetSelectedValues&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; for i = 0 to mySelections.Count - 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; txsStream.WriteLine Now &amp;amp; " " &amp;amp; mySelections.Item(i).text&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; next&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; txsStream.WriteBlankLines 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; txsStream.Close&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which is from APIGuide.qvw to write the field-values into a txt-file to find out if the field-values contain any kind of special chars which couldn't be processed through vbs or if the loop-counter isn't correct or to compare the syntax against each other (most often it are the small things ... ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2016 11:51:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Module-Code-Argument-Errors/m-p/1019543#M345086</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-03-18T11:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Module Code Argument Errors</title>
      <link>https://community.qlik.com/t5/QlikView/Module-Code-Argument-Errors/m-p/1019544#M345087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Marcus,&lt;/P&gt;&lt;P&gt;I had been trying that kind of thing and mixing MSGBOX&lt;/P&gt;&lt;P&gt;I inserted the code in-line rather than in a function&lt;/P&gt;&lt;P&gt;I get the .txt file (one folder up than expected) but it is empty&lt;/P&gt;&lt;P&gt;Unless I'm confused over the "Field" element in the script example but I have tried both "Field" and the field I am interested "ReportContext"&lt;/P&gt;&lt;P&gt;I threw a couple of message boxes in to check the flow&lt;/P&gt;&lt;P&gt;Everything points to 'i' being null but I can't seem to verify that.&lt;/P&gt;&lt;P&gt;The "&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp; ActiveDocument.ClearAll" statement at the top of my inherited code seems odd as the API Guide implies that this would clear the selections, but it does not seem to be.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2016 15:53:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Module-Code-Argument-Errors/m-p/1019544#M345087</guid>
      <dc:creator />
      <dc:date>2016-03-18T15:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: Module Code Argument Errors</title>
      <link>https://community.qlik.com/t5/QlikView/Module-Code-Argument-Errors/m-p/1019545#M345088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I never could get the log.txt file to have any content&lt;/P&gt;&lt;P&gt;After adding a bunch of msgbox statements to track the flow i was able to get it working simply by commenting out the &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;ActiveDocument.ClearAll statement&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;The Production version is working fine with the &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;ActiveDocument.ClearAll statement not commented out&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2016 17:10:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Module-Code-Argument-Errors/m-p/1019545#M345088</guid>
      <dc:creator />
      <dc:date>2016-03-18T17:10:24Z</dc:date>
    </item>
  </channel>
</rss>

