Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
tduarte
Partner - Creator II
Partner - Creator II

Problem with document/server bookmarks

Hi all,

I have a document in QV10 that allows the user to create up to 5 bookmarks.

The names of the bookmarks are predefined values on the script and are available in a multibox:

- Model1, Model2, Model3, Model4, Model5

The user can then save the bookmark by clicking on a button which calls a macro with this:

     selected_model = ActiveDocument.Evaluate("getfieldselections(_Model_bookmark_dropdown)")

     ActiveDocument.RemoveDocBookmark selected_model

     ActiveDocument.CreateDocBookmark false, selected_model

I'm using the bookmark name so that the user can recreate any of the 5 bookmarks and so that I can use them in set analysis when doing comparisons.

It all works fine in Desktop - when a bookmark is replaced by the user the previous bookmark is removed (bookmark ID changes).

The problem is that this is an online product and on the webserver (AJAX client), it doesn't remove the previous bookmark but it still creates a new one with the same name and a different ID. I can confirm this by going to the QEMC. I need to be able to remove the previous bookmark because it keeps recalling the first that was created with that name.

How can I remove the bookmark using the macro? Any alternatives?

Thanks,

Telmo

1 Solution

Accepted Solutions
tduarte
Partner - Creator II
Partner - Creator II
Author

Just an update:

The ActiveDocument.RemoveDocBookmark only works on the server if you tick the option "Allow Server Objects" on Document Properties -> Server even though "Allow Server Bookmarks" was ticked.

I reported this issue to Support and it has been confirmed as a bug.

View solution in original post

14 Replies
tduarte
Partner - Creator II
Partner - Creator II
Author

The remove document bookmark is not working!

Is it because the document bookmark on the webserver gets converted to a server bookmark?

Please help!

pat_agen
Specialist
Specialist

hi,

I think it will probably be due to the fact that users cannot remove Document bookmarks. I do not know the Ajax front end but with the plugin users accesing a document on the server cannot replace or remove a Document bookmark.

Why don't you create UserBookmarks with your macro? These can be managed by the individual user.

tduarte
Partner - Creator II
Partner - Creator II
Author

The macro using UserBookmarks doesn't even create the bookmarks on the server.

tduarte
Partner - Creator II
Partner - Creator II
Author

Just an update:

The ActiveDocument.RemoveDocBookmark only works on the server if you tick the option "Allow Server Objects" on Document Properties -> Server even though "Allow Server Bookmarks" was ticked.

I reported this issue to Support and it has been confirmed as a bug.

Not applicable

tduarte,

I can able to create bookmarks at server with macro code but i'm not able retrive particular bookmark.

To create a BM i'm running this code: Button1

Sub BM1

  selected_model = ActiveDocument.Evaluate("getfieldselections(BMark)")

  ActiveDocument.RemoveDocBookmark selected_model

  ActiveDocument.CreateDocBookmark false, selected_model

End Sub

it is working fine. But while i'm retriving the created BM it is not working.

Button2

Sub BM2

  selected_model = ActiveDocument.Evaluate("getfieldselections(BMark)")

  ActiveDocument.ClearAll false

  ActiveDocument.RecallUserBookmark selected_model

End Sub

Can you please tell me what is the problem. Please help me ASAP.


tduarte
Partner - Creator II
Partner - Creator II
Author

Hi jacq,

I havent't been able to test this but try RecallDocBookmark:

Sub BM2

  selected_model = ActiveDocument.Evaluate("getfieldselections(BMark)")

  ActiveDocument.ClearAll false

  ActiveDocument.RecallDocBookmark selected_model

End Sub

Not applicable

It is also not working

tduarte
Partner - Creator II
Partner - Creator II
Author

Not sure what the problem is then.

If you share your qvw I can test it and have a look.

Not applicable

Ok here i'm attaching my qvw file. Please check it.