Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm looking for a way to programmatically do the "replace bookmark" command using the qlikview api.
I basically do the following :
- get replaced bookmark's name and ID (by using the Document.GetBookmark(string _ID) method)
- remove the replaced bookmark
- add a bookmark with the replaced bookmark's name and ID
My problem is I didn't find a way to get the bookmarks' ID. The only API method returning a list of bookmarks is Document.GetDocBookmarkNames, which unfortunately returns only the bookmarks' names instead of the bookmarks' ids. Recalling and removing bookmark can be done using only the name, but the only way to get the bookmark object is to use the GetBookmark method which takes only id as parameters.
How can I get a list of all the document bookmarks' IDs ? Is there a way to get the ID of a bookmark when given its name ? Is it safe to assume that all IDs will be "BM{XX}", where {XX} is the index of the bookmark in the document bookmarks list ?
As always, the examples provided in the qlikview api guide do not help at all.......
Hi!
I've been dealing with a similar issue. The only good solution I could find was wokring only with unique bookmark names, and ignoring the ID, since I could find no command fetching the bookmarks ID. The idea is basically the same with getting the bookmarks name, remove it and add a new bookmark with that name.
The ID of the bookmarks created this way seems to be continually rising from BM01 and up. So far, mine has reached BM82, which indicates that they will be following the BM{ID} path. However, bookmark ID can be set manually to something else than BMxx. This is the case if you're adding bookmarks through actions, where you will have to define the new ID yourself.
Hope this can be of some guidance, even though it was not what you were looking for.
//Jakob
I got an anwswer from support :
Unfortunately it's not possible to retrieve a list of the bookmark ID's using the API.
Problem solved....
I've been looking at v9sr3 and this now seems to be working much better (maybe even earlier releases?)
Take a look at this code:
q = ActiveDocument.GetApplication.InputBox("Enter Quote Name:")
if len(q) <> 0 then ' OK clicked
ActiveDocument.CreateUserBookmark q, , , true, "Created " & weekdayName(Weekday(Date)) & " " & Now
end if
If the bookmark named q (name not ID) already exists, Qlikview automtaically prompts for a new name:
Regards,
Gordon
Anyway to get this working with AJAX client? Don't seem to get the popup input box from the AJAX client as I do on the desktop client.