Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create a "My Server Bookmark" with a macro

Hi,

is there a way, with a macro, to create a "my server" bookmark?

I'm aware of the following codes:

ActiveDocument.CreateDocBookmark false,"test"

ActiveDocument.CreateUserBookmark false,"test"

but they do no create the bookmark on the server...Any insight?

thanks!

8 Replies
marcus_sommer

I think this won't be possible. But if you want create bookmarks for server-user you could create a document-bookmark and export this and import it again as server-bookmark.

- Marcus

Not applicable
Author

Hi Marcus,

the idea is for users to press a button that will save their preferences as a bookmark (with a name pre-defined in the macro) so as the bookmark can be automatically loaded on open). Using a regular user bookmark doesnt work very well (laggy and buggy). But a server user bookmark works very well. The problem is that a macro can only create a simple user bookmark. Everything else works like a charm but it's a shame users have to manually create the bookmark so as it's saved as server user bookmark 😞

David

marcus_sommer

This could be done per actions and it should be also work on a server.

- Marcus

Not applicable
Author

The actions require the bookmark ID, which is unique per user. Setting the bookmark with a macro goes with the name instead, so it can be consistent across users. Each bookmark is unique, based on each user's selection. However, the name being the same, it's easy to load it with a macro on open.

Not applicable
Author

I was able to figure it out, using both a macro and action. The macro removes the bookmark (with the name) and the button, with action, creates a bookmark (using the same name). Works like a charm!

Not applicable
Author

Hi David,

would you mind to share your sollution in more Detail with us? As I see it you were able to create a server bookmark with a pre defined name from a macro? Sounds cool, how exactly did you do it? Thanks for sharing!

Not applicable
Author

Hi Martin,

here is how:

2 macros: one to remove any existing bookmark with the name "Default" and one to auto load that bookmark if it exists when the document opens.

sub remove_bookmark

On Error Resume Next

ActiveDocument.RemoveDocBookmark "Default"

ActiveDocument.GetApplication.WaitforIdle

ActiveDocument.RemoveUserBookmark "Default"

ActiveDocument.GetApplication.WaitforIdle

ActiveDocument.GetSheetObject("BU01").Press

end sub

The button called BU01 has an action: create bookmark, bookmark name: Default. Leave the bookmark ID blank

The button is hidden.

For some reason, Qlikview does not like it if you include this action as vb code as part of the previous code, hence the need to break it into 2 pieces (macro+button)

here is the code to use to load the bookmark (as a document trigger)

Sub UponOpen

on error goto 0

'Apply the Bookmark called "Default"

ActiveDocument.RecallDocBookmark "Default"

end sub

EternalDX
Contributor III
Contributor III

Hi,

I have the same problem with bokkmarks, i create macros when exit and enter on a Page, it function in design, but when i upload to server or in webview dont functions, any idea why?

Macros:

Sub LimpiarPozo
On Error Resume Next
ActiveDocument.CreateUserBookMark "Pozo"
ActiveDocument.GetApplication.WaitforIdle
ActiveDocument.Clear
ActiveDocument.GetApplication.WaitforIdle
ActiveDocument.RecallUserBookmark "Doc"
ActiveDocument.GetApplication.WaitforIdle
ActiveDocument.RemoveUserBookmark "Doc"
End Sub

Sub AplicarFiltroPozo
On Error Resume Next
ActiveDocument.CreateUserBookMark "Doc"
ActiveDocument.GetApplication.WaitforIdle
ActiveDocument.Clear
ActiveDocument.GetApplication.WaitforIdle
ActiveDocument.RecallUserBookmark "Pozo"
ActiveDocument.GetApplication.WaitforIdle
ActiveDocument.RemoveUserBookmark "Pozo"
End Sub