<?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 API ImportBookmarks - causing duplicates on server in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/API-ImportBookmarks-causing-duplicates-on-server/m-p/1019312#M345018</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'm trying to do something that means that I can load specific sets of bookmarks on document startup depending upon the logged in user... and it works GREAT in the Personal Edition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, deploying this on the server is causing some issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the server, when the doc loads, my test user is associated with three bookmarks which I determine in a macro and then load each in turn.&amp;nbsp; Each of the bookmark files contains a single bookmark with pretty simple filtering, just proof-of-concept at the moment;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* Global: No Filtering&lt;/P&gt;&lt;P&gt;* Birmingham: Branch = "Birmingham"&lt;/P&gt;&lt;P&gt;* Manchester: Branch = "Manchester"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, having determined the list of bookmark files I then proceed to load them, with a bit of reassuring debugging.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;for iLoop = 0 to ubound ( vArray ) - 1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;msgbox "Applying " &amp;amp; vArray( iLoop ) &amp;amp; " for user " &amp;amp; strOSUser&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;ActiveDocument.ImportBookmarks vArray( iLoop ), 0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;next&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;What's happening in PE is that I get three bookmarks, and I can press a button and manually repeat the process and I've still got three bookmarks.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the server though, it seems as though every time I load a BM file, as well as adding the new BM it is also duplicating all of the BMs that are already present.&amp;nbsp; (Let me point out at this point that I have tried 0, 1, 2, and 3 as the last parameter on the ImportBookmarks call and it's the same.)&amp;nbsp; (It's also creating the things as Server bookmarks, but I'm not too fussed about that.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, what is happening is;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Import Global.VM.XML&lt;UL&gt;&lt;LI&gt;Bookmark Global created&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Import Birmingham.BM.XML&lt;UL&gt;&lt;LI&gt;Bookmark Global *DUPLICATED*&lt;/LI&gt;&lt;LI&gt;Bookmark Birmingham created&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Import Manchester.BM.XML&lt;UL&gt;&lt;LI&gt;Bookmark Global DUPLICATED&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Bookmark Global DUPLICATED&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Bookmark Birmingham DUPLICATED&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Bookmark Manchester created&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, although I have imported three files each with one BM in them I now have 4 x Global, 2 x Birmingham, and 1 x Manchester... and this happens no matter what I put as the last parameter on the ImportBookmarks call - the one that is supposed to control how duplicates are handled.&amp;nbsp; (And if I press the 'test it manually' button and load the same 3 BM files I end up with something like 56!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the question:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*** What makes that last parameter exclude a bookmark from being imported please?&amp;nbsp; What is it that QV is checking to see if it's a duplicate?&amp;nbsp; If it's the ID then I guess I'm a bit done-for as the BMs are assigned new IDs when they get imported.&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;What do I set the last value to, as 0, 1, 2, and 3 seem to all have the same effect and there's no duplicate stripping performed at all on the Server version, but the PE is working just dandy. ***&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oh, and it's not just duplicating the ones that I import, it's all Server bookmarks, eg/&amp;nbsp; If I have 10 Server bookmarks that I've created manually and I use the API to import another, I now have 21 user bookmarks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is using QV V11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Untold thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Mar 2016 18:03:52 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-03-30T18:03:52Z</dc:date>
    <item>
      <title>API ImportBookmarks - causing duplicates on server</title>
      <link>https://community.qlik.com/t5/QlikView/API-ImportBookmarks-causing-duplicates-on-server/m-p/1019312#M345018</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'm trying to do something that means that I can load specific sets of bookmarks on document startup depending upon the logged in user... and it works GREAT in the Personal Edition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, deploying this on the server is causing some issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the server, when the doc loads, my test user is associated with three bookmarks which I determine in a macro and then load each in turn.&amp;nbsp; Each of the bookmark files contains a single bookmark with pretty simple filtering, just proof-of-concept at the moment;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* Global: No Filtering&lt;/P&gt;&lt;P&gt;* Birmingham: Branch = "Birmingham"&lt;/P&gt;&lt;P&gt;* Manchester: Branch = "Manchester"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, having determined the list of bookmark files I then proceed to load them, with a bit of reassuring debugging.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;for iLoop = 0 to ubound ( vArray ) - 1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;msgbox "Applying " &amp;amp; vArray( iLoop ) &amp;amp; " for user " &amp;amp; strOSUser&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;ActiveDocument.ImportBookmarks vArray( iLoop ), 0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;next&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;What's happening in PE is that I get three bookmarks, and I can press a button and manually repeat the process and I've still got three bookmarks.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the server though, it seems as though every time I load a BM file, as well as adding the new BM it is also duplicating all of the BMs that are already present.&amp;nbsp; (Let me point out at this point that I have tried 0, 1, 2, and 3 as the last parameter on the ImportBookmarks call and it's the same.)&amp;nbsp; (It's also creating the things as Server bookmarks, but I'm not too fussed about that.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, what is happening is;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Import Global.VM.XML&lt;UL&gt;&lt;LI&gt;Bookmark Global created&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Import Birmingham.BM.XML&lt;UL&gt;&lt;LI&gt;Bookmark Global *DUPLICATED*&lt;/LI&gt;&lt;LI&gt;Bookmark Birmingham created&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Import Manchester.BM.XML&lt;UL&gt;&lt;LI&gt;Bookmark Global DUPLICATED&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Bookmark Global DUPLICATED&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Bookmark Birmingham DUPLICATED&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Bookmark Manchester created&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, although I have imported three files each with one BM in them I now have 4 x Global, 2 x Birmingham, and 1 x Manchester... and this happens no matter what I put as the last parameter on the ImportBookmarks call - the one that is supposed to control how duplicates are handled.&amp;nbsp; (And if I press the 'test it manually' button and load the same 3 BM files I end up with something like 56!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the question:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*** What makes that last parameter exclude a bookmark from being imported please?&amp;nbsp; What is it that QV is checking to see if it's a duplicate?&amp;nbsp; If it's the ID then I guess I'm a bit done-for as the BMs are assigned new IDs when they get imported.&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;What do I set the last value to, as 0, 1, 2, and 3 seem to all have the same effect and there's no duplicate stripping performed at all on the Server version, but the PE is working just dandy. ***&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oh, and it's not just duplicating the ones that I import, it's all Server bookmarks, eg/&amp;nbsp; If I have 10 Server bookmarks that I've created manually and I use the API to import another, I now have 21 user bookmarks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is using QV V11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Untold thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2016 18:03:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/API-ImportBookmarks-causing-duplicates-on-server/m-p/1019312#M345018</guid>
      <dc:creator />
      <dc:date>2016-03-30T18:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: API ImportBookmarks - causing duplicates on server</title>
      <link>https://community.qlik.com/t5/QlikView/API-ImportBookmarks-causing-duplicates-on-server/m-p/1019313#M345019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FYI - Anyone reading this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This was raised with QV support and it will not work on the server (and it's not going to be fixed).&amp;nbsp; However, as I mentioned, it works great if you are using the desktop/Personal Edition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Give me a nudge if you want info on how it's done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 15:28:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/API-ImportBookmarks-causing-duplicates-on-server/m-p/1019313#M345019</guid>
      <dc:creator />
      <dc:date>2016-04-06T15:28:38Z</dc:date>
    </item>
  </channel>
</rss>

