<?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 call macro from load script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/call-macro-from-load-script/m-p/158970#M33797</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to call this macro to create alerts from the load script:&lt;/P&gt;&lt;P&gt;Function alertCreate ()&lt;BR /&gt;rem create new alert with mail&lt;BR /&gt;dim docprop, al, no, no2&lt;BR /&gt;set docprop = ActiveDocument.GetProperties&lt;BR /&gt;set al = docprop.Alerts&lt;BR /&gt;al.Add&lt;BR /&gt;no = al.Count-1&lt;BR /&gt;al.Item(no).Action.Id = "AL04"&lt;BR /&gt;al.Item(no).Action.SuppressPopup = true&lt;BR /&gt;al.Item(no).Action.Message.v = "Hello world!"&lt;BR /&gt;al.Item(no).Action.MailRecipients.Add&lt;BR /&gt;no2 = al.Item(no).Action.MailRecipients.Count-1&lt;BR /&gt;al.Item(no).Action.MailRecipients.Item(no2).v = "santa.claus@northpole.gov"&lt;BR /&gt;al.Item(no).Action.MailSubject.v = "Alert: Hello world!"&lt;BR /&gt;al.Item(no).Comment = "New alert"&lt;BR /&gt;al.Item(no).Condition.AllClear = false&lt;BR /&gt;al.Item(no).Condition.BookmarkId = "BM01"&lt;BR /&gt;al.Item(no).Condition.Condition.v = "sum(Sales)&amp;gt;Sum(Budget)"&lt;BR /&gt;al.Item(no).Enabled = true&lt;BR /&gt;al.Item(no).Triggers.Interactive = true&lt;BR /&gt;al.Item(no).Triggers.OnPostReload = true&lt;BR /&gt;ActiveDocument.SetProperties docprop&lt;BR /&gt;end Function&lt;/P&gt;&lt;P&gt;And then I want to call it from the load script like:&lt;/P&gt;&lt;P&gt;LET b = alertCreate();&lt;/P&gt;&lt;P&gt;The alert is not created after doing a reload. I cannot use the OnPostReload event because I want to use the publisher. My question is, if I finally make this macro work (using the call from the script), later, when running the reload from the publisher, is it going to execute the macro call when the script arrives to this line? Or it will happen the same as when using OnPostReload event?&lt;/P&gt;&lt;P&gt;In oder words, the publisher will not execute any kind of macro in any part of the document: in the load script, in the document events using the trigger&amp;lt;external&amp;lt;run macro...&lt;/P&gt;&lt;P&gt;Was it understandable?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Mar 2011 11:22:31 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-03-14T11:22:31Z</dc:date>
    <item>
      <title>call macro from load script</title>
      <link>https://community.qlik.com/t5/QlikView/call-macro-from-load-script/m-p/158970#M33797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to call this macro to create alerts from the load script:&lt;/P&gt;&lt;P&gt;Function alertCreate ()&lt;BR /&gt;rem create new alert with mail&lt;BR /&gt;dim docprop, al, no, no2&lt;BR /&gt;set docprop = ActiveDocument.GetProperties&lt;BR /&gt;set al = docprop.Alerts&lt;BR /&gt;al.Add&lt;BR /&gt;no = al.Count-1&lt;BR /&gt;al.Item(no).Action.Id = "AL04"&lt;BR /&gt;al.Item(no).Action.SuppressPopup = true&lt;BR /&gt;al.Item(no).Action.Message.v = "Hello world!"&lt;BR /&gt;al.Item(no).Action.MailRecipients.Add&lt;BR /&gt;no2 = al.Item(no).Action.MailRecipients.Count-1&lt;BR /&gt;al.Item(no).Action.MailRecipients.Item(no2).v = "santa.claus@northpole.gov"&lt;BR /&gt;al.Item(no).Action.MailSubject.v = "Alert: Hello world!"&lt;BR /&gt;al.Item(no).Comment = "New alert"&lt;BR /&gt;al.Item(no).Condition.AllClear = false&lt;BR /&gt;al.Item(no).Condition.BookmarkId = "BM01"&lt;BR /&gt;al.Item(no).Condition.Condition.v = "sum(Sales)&amp;gt;Sum(Budget)"&lt;BR /&gt;al.Item(no).Enabled = true&lt;BR /&gt;al.Item(no).Triggers.Interactive = true&lt;BR /&gt;al.Item(no).Triggers.OnPostReload = true&lt;BR /&gt;ActiveDocument.SetProperties docprop&lt;BR /&gt;end Function&lt;/P&gt;&lt;P&gt;And then I want to call it from the load script like:&lt;/P&gt;&lt;P&gt;LET b = alertCreate();&lt;/P&gt;&lt;P&gt;The alert is not created after doing a reload. I cannot use the OnPostReload event because I want to use the publisher. My question is, if I finally make this macro work (using the call from the script), later, when running the reload from the publisher, is it going to execute the macro call when the script arrives to this line? Or it will happen the same as when using OnPostReload event?&lt;/P&gt;&lt;P&gt;In oder words, the publisher will not execute any kind of macro in any part of the document: in the load script, in the document events using the trigger&amp;lt;external&amp;lt;run macro...&lt;/P&gt;&lt;P&gt;Was it understandable?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2011 11:22:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/call-macro-from-load-script/m-p/158970#M33797</guid>
      <dc:creator />
      <dc:date>2011-03-14T11:22:31Z</dc:date>
    </item>
    <item>
      <title>call macro from load script</title>
      <link>https://community.qlik.com/t5/QlikView/call-macro-from-load-script/m-p/158971#M33798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you cannot call this type of macro from within your load script because ActiveDocument is not available while the load-script is running.&lt;/P&gt;&lt;P&gt;Regards&lt;BR /&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2011 11:40:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/call-macro-from-load-script/m-p/158971#M33798</guid>
      <dc:creator>Stefan_Walther</dc:creator>
      <dc:date>2011-03-14T11:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: call macro from load script</title>
      <link>https://community.qlik.com/t5/QlikView/call-macro-from-load-script/m-p/158972#M33799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am able to call the macro and send the email but I just can't pass the variable. Is there another way besides ActiveDocument to get the variable passed?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there another kind of macro I should be using?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2018 20:29:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/call-macro-from-load-script/m-p/158972#M33799</guid>
      <dc:creator>dhborchardt</dc:creator>
      <dc:date>2018-07-09T20:29:11Z</dc:date>
    </item>
  </channel>
</rss>

